Skip to content

Commit

Permalink
fixes bug
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Apr 9, 2024
1 parent c2b3031 commit 97974fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/sandbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ local function sandbox_env(env, loadlua, openfile, preload, builddir)
local main, extra = require_load(name)
debug.setupvalue(main, 1, env)
local _, res = xpcall(main, function (errmsg)
log.fatal(errmsg)
log.fatal("%s", errmsg)
end, extra)
if res ~= nil then
_LOADED[name] = res
Expand Down Expand Up @@ -154,7 +154,7 @@ local function sandbox_env(env, loadlua, openfile, preload, builddir)
function env.dofile(filename)
local f, err = loadlua(filename)
if not f then
log.fatal(err)
log.fatal("%s", err)
return
end
return f()
Expand Down Expand Up @@ -190,11 +190,11 @@ return function (c)
end
local main, err = sandbox_loadlua(c.main)
if not main then
log.fatal(err)
log.fatal("%s", err)
return
end
debug.setupvalue(main, 1, sandbox_env(env, sandbox_loadlua, sandbox_openfile, c.preload, c.builddir))
xpcall(main, function (errmsg)
log.fatal(errmsg)
log.fatal("%s", errmsg)
end, table.unpack(c.args))
end

0 comments on commit 97974fe

Please sign in to comment.