From 62cb31e04b73d5e37706ea3dddefc5263b60648e Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 22 Aug 2008 15:35:57 +0000 Subject: Bugfix resolving problem when config file is missing. git-svn-id: svn://svn.alpinelinux.org/acf/openntpd/trunk@1393 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openntpd-model.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openntpd-model.lua b/openntpd-model.lua index 3869ee9..b5405b9 100644 --- a/openntpd-model.lua +++ b/openntpd-model.lua @@ -22,7 +22,7 @@ local function config_content( f ) local config = {} config.name = f local conf_file = fs.read_file_as_array ( config.name ) - for i=1,table.maxn(conf_file) do + for i=1,table.maxn((conf_file or {})) do local l = conf_file[i] -- Filter out commented lines if not string.find ( l, "^[;#].*" ) then @@ -239,7 +239,7 @@ end function getconfig () local path = configfile local config = {} - local configopts = getopts.getoptsfromfile(confdfile, "") + local configopts = getopts.getoptsfromfile(confdfile, "") or {} configopts["variables"] = config_content(path) -- cgit v1.2.3