From b1d60bb06a493b1bd02ea4f02ec7b3656063dba3 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Mon, 28 Oct 2024 23:30:04 +1000 Subject: Various minor tweaks and cleanups. --- PolygLua.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'PolygLua.lua') diff --git a/PolygLua.lua b/PolygLua.lua index 20925b7..8d63d8a 100755 --- a/PolygLua.lua +++ b/PolygLua.lua @@ -106,7 +106,7 @@ _.parse = function(args, options, confFile) if nil ~= confFile then for i,v in ipairs{'/etc/', '~/.', './.'} do local p = v .. confFile .. '.conf.lua' - local h, e = io.open(p, 'r') + local h = io.open(p, 'r') if nil ~= h then D('Found configuration file '.. p) h:close() @@ -124,9 +124,9 @@ _.parse = function(args, options, confFile) local ds = 0 if ('-' == a:sub(1, 1)) and ('-' ~= a:sub(2, 2)) then ds = 1 end if '--' == a:sub(1, 2) then ds = 2; a = a:sub(3, -1) end - local s, e = a:find('=') + local s, e = a:find('=', 1, true) local k , v - if nil == s then + if not s then e = 0 v = nil else @@ -158,7 +158,7 @@ _.running = function(c) end _.exists = function(f) - local h, e = io.open(f, 'r') + local h = io.open(f, 'r') if nil == h then return false else h:close(); return true end end @@ -222,7 +222,7 @@ _G.__ = function(c) end if exe.isScript then local a, e = io.open(exe.scriptFile, 'w') - if nil == a then E('Could not open ' .. exe.scriptFile) else + if nil == a then E('Could not open ' .. exe.scriptFile .. ' - ' .. e) else a:write(exe.script) a:close() end -- cgit v1.1