aboutsummaryrefslogtreecommitdiff
path: root/src/compat.c
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2018-11-27 15:39:25 +0100
committerBenoit Germain <bnt.germain@gmail.com>2018-11-27 15:39:25 +0100
commiteae02827ca659a25949c212d8e53dd4334df32d0 (patch)
treedac3765850f77b58a0cc15292e91dc465ce1e110 /src/compat.c
parent5323d25231d327bfbdf12e1fc077903383bf8739 (diff)
downloadlanes-eae02827ca659a25949c212d8e53dd4334df32d0.tar.gz
lanes-eae02827ca659a25949c212d8e53dd4334df32d0.tar.bz2
lanes-eae02827ca659a25949c212d8e53dd4334df32d0.zip
replace hardcoded "_LOADED" with lua-provided LUA_LOADED_TABLE
Diffstat (limited to 'src/compat.c')
-rw-r--r--src/compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compat.c b/src/compat.c
index 1a66f38..c5e29f5 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -30,7 +30,7 @@ void luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int
30 lua_pushcfunction(L, openf); 30 lua_pushcfunction(L, openf);
31 lua_pushstring(L, modname); /* argument to open function */ 31 lua_pushstring(L, modname); /* argument to open function */
32 lua_call(L, 1, 1); /* open module */ 32 lua_call(L, 1, 1); /* open module */
33 luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); 33 luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE);
34 lua_pushvalue(L, -2); /* make copy of module (call result) */ 34 lua_pushvalue(L, -2); /* make copy of module (call result) */
35 lua_setfield(L, -2, modname); /* _LOADED[modname] = module */ 35 lua_setfield(L, -2, modname); /* _LOADED[modname] = module */
36 lua_pop(L, 1); /* remove _LOADED table */ 36 lua_pop(L, 1); /* remove _LOADED table */