summaryrefslogtreecommitdiff
path: root/src/ffi/lua51
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2022-05-30 21:45:25 +0100
committerAlex Orlenko <zxteam@protonmail.com>2022-05-30 21:45:25 +0100
commita100ebb3d79c1de0e57e0a5e1d00c6c64f3af710 (patch)
tree815999a69d25c3a0849b7405be3f7f2eaba893f0 /src/ffi/lua51
parenta05a58b2588377bcb214f0ef28c1342b3b67dc17 (diff)
downloadmlua-a100ebb3d79c1de0e57e0a5e1d00c6c64f3af710.zip
Fix luaL_requiref glb handling for Lua<=5.1
Diffstat (limited to 'src/ffi/lua51')
-rw-r--r--src/ffi/lua51/compat.rs5
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);
}