Commit 38e9a058 authored by Ted Trask's avatar Ted Trask

Removed getopts library and added functionality to format library as...

Removed getopts library and added functionality to format library as opts_to_table, table_to_opts, parse_configfile2, update_configfile2, get_section, and set_section.  New functions work on strings, not files.  Modified all code using getopts to use format instead. Fixed nil string bugs in TCPProxy.  Fixed forward only bug in DNSCache.

git-svn-id: svn://svn.alpinelinux.org/acf/fetchmail/trunk@1535 ab2d0c66-481e-0410-8bed-d214d4d58bed
parent 08e37117
......@@ -4,7 +4,7 @@ module(..., package.seeall)
require("modelfunctions")
require("posix")
require("fs")
require("getopts")
require("format")
require("validator")
-- Set variables
......@@ -338,7 +338,7 @@ function getconfig()
end
end
local confd = getopts.getoptsfromfile(confdfile, "", "polling_period")
local confd = format.parse_configfile2(fs.read_file(confdfile), "", "polling_period")
if confd then
interval.value = confd
end
......@@ -376,7 +376,7 @@ function updateconfig(conf)
posix.chmod(configfile, "rwx--x---")
config = nil
getopts.setoptsinfile(confdfile, "", "polling_period", '"'..conf.value.interval.value..'"')
fs.write_file(confdfile, format.update_configfile2(fs.read_file(confdfile) or "", "", "polling_period", '"'..conf.value.interval.value..'"'))
else
conf.errtxt = "Failed to set configuration"
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment