Fix the problems caused by the fixes to the previous problems caused by the original fix

This commit is contained in:
v 2020-12-29 13:50:56 +00:00
parent 0edc70bac8
commit b2b8430a68
1 changed files with 5 additions and 1 deletions

View File

@ -6,7 +6,11 @@ local function loader(mn)
at=shell.dir().."/lib/"..mn..".lua"
end
if at then
return function() return os.run(_ENV,at) end
local e=getfenv(1)
if e.package and #e.package.loaders==2 then
table.insert(e.package.loaders,loader)
end
return loadfile(at,nil,e)
end
return false,"\t\tno file '/lib/"..mn..".lua\n\t\tno file '"..shell.dir().."/lib/"..mn..".lua"
end