summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-10-03 12:42:13 +0000
committerTed Trask <ttrask01@yahoo.com>2008-10-03 12:42:13 +0000
commit938c81199933cc10fc231d6c017d65b4507ea5cc (patch)
tree92558ec696162677671017e2fe215e358daa13d7
parent38e9a058e30495487112517bf0a8365d3e909db8 (diff)
downloadacf-fetchmail-938c81199933cc10fc231d6c017d65b4507ea5cc.tar.bz2
acf-fetchmail-938c81199933cc10fc231d6c017d65b4507ea5cc.tar.xz
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
-rw-r--r--fetchmail-model.lua8
1 files changed, 4 insertions, 4 deletions
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