diff options
Diffstat (limited to 'src/conf.lua')
-rw-r--r-- | src/conf.lua | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/conf.lua b/src/conf.lua index a0af5d3..44546cc 100644 --- a/src/conf.lua +++ b/src/conf.lua @@ -21,13 +21,19 @@ local conf = {} -local file = assert(io.open(conffile, "r")) -for line in file:lines() do - local k,v = string.match(line, "^([^=#]+)=(.*)$") - if k and v and v ~= "" then - conf[k] = v +function conf.load(conffile) + local cnf = {} + + local file = assert(io.open(conffile, "r")) + for line in file:lines() do + local k,v = string.match(line, "^([^=#]+)=(.*)$") + if k and v and v ~= "" then + cnf[k] = v + end end + file:close() + + return cnf end -file:close() return conf |