From 38e9a058e30495487112517bf0a8365d3e909db8 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 29 Sep 2008 18:01:28 +0000 Subject: 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 --- fetchmail-model.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetchmail-model.lua b/fetchmail-model.lua index 8aa114f..fa7dbf2 100644 --- a/fetchmail-model.lua +++ b/fetchmail-model.lua @@ -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 -- cgit v1.2.3