1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-30 23:23:03 +00:00

path fix + compat changes

This commit is contained in:
kepler155c@gmail.com
2019-07-20 16:23:48 -06:00
parent 09be81be27
commit 30b7199976
4 changed files with 6 additions and 7 deletions

View File

@@ -490,7 +490,7 @@ function Util.loadTable(fname)
if not fc then
return false, 'Unable to read file'
end
local s, m = load('return ' .. fc, fname)
local s, m = loadstring('return ' .. fc, fname)
if s then
s, m = pcall(s)
if s then
@@ -551,9 +551,8 @@ function Util.run(env, path, ...)
end
function Util.runFunction(env, fn, ...)
--setfenv(fn, env)
setfenv(fn, env)
setmetatable(env, { __index = _G })
fn = load(fn,"util.runfunction",nil,env)
return pcall(fn, ...)
end