Fix luaL_requiref glb handling for Lua<=5.1
This commit is contained in:
parent
a05a58b258
commit
a100ebb3d7
|
@ -568,11 +568,10 @@ pub unsafe fn luaL_requiref(
|
|||
lua_getfield(L, -1, modname);
|
||||
}
|
||||
}
|
||||
if cfg!(feature = "lua51") && glb != 0 {
|
||||
if glb != 0 {
|
||||
lua_pushvalue(L, -1);
|
||||
lua_setglobal(L, modname);
|
||||
}
|
||||
if cfg!(feature = "luajit") && glb == 0 {
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
lua_setglobal(L, modname);
|
||||
}
|
||||
|
|
|
@ -513,6 +513,9 @@ pub unsafe fn luaL_requiref(
|
|||
if glb != 0 {
|
||||
lua_pushvalue(L, -1);
|
||||
lua_setglobal(L, modname);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
lua_setglobal(L, modname);
|
||||
}
|
||||
lua_replace(L, -2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue