diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2022-05-30 21:45:25 +0100 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2022-05-30 21:45:25 +0100 |
commit | a100ebb3d79c1de0e57e0a5e1d00c6c64f3af710 (patch) | |
tree | 815999a69d25c3a0849b7405be3f7f2eaba893f0 /src/ffi/lua51 | |
parent | a05a58b2588377bcb214f0ef28c1342b3b67dc17 (diff) | |
download | mlua-a100ebb3d79c1de0e57e0a5e1d00c6c64f3af710.zip |
Fix luaL_requiref glb handling for Lua<=5.1
Diffstat (limited to 'src/ffi/lua51')
-rw-r--r-- | src/ffi/lua51/compat.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ffi/lua51/compat.rs b/src/ffi/lua51/compat.rs index 9cd46fb..c67dbe0 100644 --- a/src/ffi/lua51/compat.rs +++ b/src/ffi/lua51/compat.rs @@ -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); } |