bug and warning fixes from auios
This commit is contained in:
BIN
BlockLua.dll
BIN
BlockLua.dll
Binary file not shown.
@@ -38,7 +38,7 @@ end
|
||||
-- chains a bunch of filters together
|
||||
-- (thanks to Wim Couwenberg)
|
||||
function filter.chain(...)
|
||||
local n = table.getn(arg)
|
||||
local n = #arg
|
||||
local top, index = 1, 1
|
||||
local retry = ""
|
||||
return function(chunk)
|
||||
|
||||
@@ -254,7 +254,7 @@ function parse_path(path)
|
||||
path = path or ""
|
||||
--path = string.gsub(path, "%s", "")
|
||||
string.gsub(path, "([^/]+)", function (s) table.insert(parsed, s) end)
|
||||
for i = 1, table.getn(parsed) do
|
||||
for i = 1, #parsed do
|
||||
parsed[i] = unescape(parsed[i])
|
||||
end
|
||||
if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end
|
||||
@@ -272,7 +272,7 @@ end
|
||||
-----------------------------------------------------------------------------
|
||||
function build_path(parsed, unsafe)
|
||||
local path = ""
|
||||
local n = table.getn(parsed)
|
||||
local n = #parsed
|
||||
if unsafe then
|
||||
for i = 1, n-1 do
|
||||
path = path .. parsed[i]
|
||||
|
||||
@@ -466,7 +466,7 @@ local tsMeta = {
|
||||
elseif name:find('::') then
|
||||
local ns, rest = name:match('^([^:]+)::(.+)$')
|
||||
if not ns then error('ts index: invalid name \''..name..'\'', 2) end
|
||||
if not rest:find('::') and tsIsFunction(ns, rest) then
|
||||
if not rest:find('::') and tsIsFunctionNs(ns, rest) then
|
||||
error('ts index: can\'t call a namespaced function from lua', 2)
|
||||
else
|
||||
return valFromTs(_bllua_ts.getvar(name), name)
|
||||
@@ -555,9 +555,9 @@ function bl.schedule(time, cb, ...)
|
||||
return sch
|
||||
end
|
||||
function _bllua_schedule_callback(id)
|
||||
id = tonumber(id)
|
||||
id = tonumber(id) or error('_bllua_schedule_callback: invalid id: '..tostring(id))
|
||||
local sch = bl._scheduleTable[id]
|
||||
if not sch then error('_ts_schedule_callback: no schedule with id '..id) end
|
||||
if not sch then error('_bllua_schedule_callback: no schedule with id '..id) end
|
||||
bl._scheduleTable[id] = nil
|
||||
sch.callback(unpack(sch.args))
|
||||
end
|
||||
@@ -673,7 +673,7 @@ function bl.unhook(pkg, name, time)
|
||||
if bl._hooks[pkg][name] then
|
||||
if not time then
|
||||
bl._hooks[pkg][name] = nil
|
||||
if table.isempty(bl._hooks[pkg]) then
|
||||
if table.empty(bl._hooks[pkg]) then
|
||||
bl._hooks[pkg] = nil
|
||||
deactivatePackage(pkg)
|
||||
end
|
||||
@@ -683,7 +683,7 @@ function bl.unhook(pkg, name, time)
|
||||
error('bl.unhook: argument #3: time must be nil or one of '..
|
||||
'\'before\' \'after\' \'override\'', 2) end
|
||||
bl._hooks[pkg][name][time] = nil
|
||||
if table.isempty(bl._hooks[pkg][name]) and table.empty(bl._hooks[pkg]) then
|
||||
if table.empty(bl._hooks[pkg][name]) and table.empty(bl._hooks[pkg]) then
|
||||
bl._hooks[pkg] = nil
|
||||
deactivatePackage(pkg)
|
||||
end
|
||||
|
||||
@@ -116,13 +116,13 @@ function io.open(fn, mode, errn)
|
||||
local relfn = curfn and fn:find('^%./') and
|
||||
curfn:gsub('[^/]+$', '')..fn:gsub('^%./', '')
|
||||
if relfn then
|
||||
local fi, err = io_open_absolute(relfn, mode, errn+1)
|
||||
local fi, err = io_open_absolute(relfn, mode)
|
||||
return fi, err, relfn
|
||||
else
|
||||
return nil, 'Invalid path', fn
|
||||
end
|
||||
else
|
||||
local fi, err = io_open_absolute(fn, mode, errn+1)
|
||||
local fi, err = io_open_absolute(fn, mode)
|
||||
return fi, err, fn
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user