diff options
author | dvs1 | 2024-10-28 23:30:04 +1000 |
---|---|---|
committer | dvs1 | 2024-10-28 23:30:04 +1000 |
commit | b1d60bb06a493b1bd02ea4f02ec7b3656063dba3 (patch) | |
tree | 6e91329cc7e7db31c31b0fa6dfc06ef907bff428 /PolygLua.lua | |
parent | Minor tweaks. (diff) | |
download | JackOnAllDevices-b1d60bb06a493b1bd02ea4f02ec7b3656063dba3.zip JackOnAllDevices-b1d60bb06a493b1bd02ea4f02ec7b3656063dba3.tar.gz JackOnAllDevices-b1d60bb06a493b1bd02ea4f02ec7b3656063dba3.tar.bz2 JackOnAllDevices-b1d60bb06a493b1bd02ea4f02ec7b3656063dba3.tar.xz |
Various minor tweaks and cleanups.
Diffstat (limited to '')
-rwxr-xr-x | PolygLua.lua | 10 |
1 files changed, 5 insertions, 5 deletions
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) | |||
106 | if nil ~= confFile then | 106 | if nil ~= confFile then |
107 | for i,v in ipairs{'/etc/', '~/.', './.'} do | 107 | for i,v in ipairs{'/etc/', '~/.', './.'} do |
108 | local p = v .. confFile .. '.conf.lua' | 108 | local p = v .. confFile .. '.conf.lua' |
109 | local h, e = io.open(p, 'r') | 109 | local h = io.open(p, 'r') |
110 | if nil ~= h then | 110 | if nil ~= h then |
111 | D('Found configuration file '.. p) | 111 | D('Found configuration file '.. p) |
112 | h:close() | 112 | h:close() |
@@ -124,9 +124,9 @@ _.parse = function(args, options, confFile) | |||
124 | local ds = 0 | 124 | local ds = 0 |
125 | if ('-' == a:sub(1, 1)) and ('-' ~= a:sub(2, 2)) then ds = 1 end | 125 | if ('-' == a:sub(1, 1)) and ('-' ~= a:sub(2, 2)) then ds = 1 end |
126 | if '--' == a:sub(1, 2) then ds = 2; a = a:sub(3, -1) end | 126 | if '--' == a:sub(1, 2) then ds = 2; a = a:sub(3, -1) end |
127 | local s, e = a:find('=') | 127 | local s, e = a:find('=', 1, true) |
128 | local k , v | 128 | local k , v |
129 | if nil == s then | 129 | if not s then |
130 | e = 0 | 130 | e = 0 |
131 | v = nil | 131 | v = nil |
132 | else | 132 | else |
@@ -158,7 +158,7 @@ _.running = function(c) | |||
158 | end | 158 | end |
159 | 159 | ||
160 | _.exists = function(f) | 160 | _.exists = function(f) |
161 | local h, e = io.open(f, 'r') | 161 | local h = io.open(f, 'r') |
162 | if nil == h then return false else h:close(); return true end | 162 | if nil == h then return false else h:close(); return true end |
163 | end | 163 | end |
164 | 164 | ||
@@ -222,7 +222,7 @@ _G.__ = function(c) | |||
222 | end | 222 | end |
223 | if exe.isScript then | 223 | if exe.isScript then |
224 | local a, e = io.open(exe.scriptFile, 'w') | 224 | local a, e = io.open(exe.scriptFile, 'w') |
225 | if nil == a then E('Could not open ' .. exe.scriptFile) else | 225 | if nil == a then E('Could not open ' .. exe.scriptFile .. ' - ' .. e) else |
226 | a:write(exe.script) | 226 | a:write(exe.script) |
227 | a:close() | 227 | a:close() |
228 | end | 228 | end |