Hopefully fix a problem bam.lua that I don't see locally

Error message is:

    configure.lua:6: bad argument #1 to 'setfenv' (number expected, got nil)
This commit is contained in:
heinrich5991 2016-08-03 00:16:40 +02:00
parent fb5c34da4e
commit 1ce581cab5

View file

@ -3,7 +3,9 @@ function loadfile_(filename, env)
local file
if _VERSION == "Lua 5.1" then
file = loadfile(filename)
setfenv(file, env)
if file then
setfenv(file, env)
end
else
file = loadfile(filename, nil, env)
end