From 938c81199933cc10fc231d6c017d65b4507ea5cc Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 3 Oct 2008 12:42:13 +0000 Subject: Modified format library. parse_configfile2, update_configfile2, get_section, and set_section became parse_ini_file, update_ini_file, get_ini_section, and set_ini_section. Updated all code that used these functions. git-svn-id: svn://svn.alpinelinux.org/acf/fetchmail/trunk@1539 ab2d0c66-481e-0410-8bed-d214d4d58bed --- fetchmail-model.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fetchmail-model.lua') diff --git a/fetchmail-model.lua b/fetchmail-model.lua index fa7dbf2..d3dd51c 100644 --- a/fetchmail-model.lua +++ b/fetchmail-model.lua @@ -325,7 +325,7 @@ function update_filecontent(filedetails) end function getconfig() - local interval = cfe({ value=60, label="Polling Interval", descr="Interval in seconds" }) + local interval = cfe({ value="60", label="Polling Interval", descr="Interval in seconds" }) local postmaster = cfe({ label="Postmaster", descr="If defined, undeliverable mail is sent to this account, otherwise it is discarded" }) local bounceerrors = cfe({ type="boolean", value=true, label="Bounce Errors", descr="Bounce errors back to the sender or send them to the postmaster" }) @@ -338,9 +338,9 @@ function getconfig() end end - local confd = format.parse_configfile2(fs.read_file(confdfile), "", "polling_period") + local confd = format.parse_ini_file(fs.read_file(confdfile), "", "polling_period") if confd then - interval.value = confd + interval.value = string.sub(confd, 2, -2) end return cfe({ type="group", value={interval=interval, postmaster=postmaster, bounceerrors=bounceerrors}, label="Fetchmail Global Config" }) @@ -376,7 +376,7 @@ function updateconfig(conf) posix.chmod(configfile, "rwx--x---") config = nil - fs.write_file(confdfile, format.update_configfile2(fs.read_file(confdfile) or "", "", "polling_period", '"'..conf.value.interval.value..'"')) + fs.write_file(confdfile, format.update_ini_file(fs.read_file(confdfile) or "", "", "polling_period", '"'..conf.value.interval.value..'"')) else conf.errtxt = "Failed to set configuration" end -- cgit v1.2.3