From 9b8226101ce2c0657d5555de23d09be2aa146a4b Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 27 May 2018 15:23:23 -0400 Subject: Refer to Lua's 'package.loaded' table name by constant, not literal. --- src/textadept.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/textadept.c b/src/textadept.c index 3433a149..afbb7ee7 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1492,10 +1492,10 @@ static int lL_init(lua_State *L, int argc, char **argv, int reinit) { lua_setfield(L, LUA_REGISTRYINDEX, "ta_arg"); lua_newtable(L), lua_setfield(L, LUA_REGISTRYINDEX, "ta_buffers"); lua_newtable(L), lua_setfield(L, LUA_REGISTRYINDEX, "ta_views"); - } else { // clear _LOADED and _G - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + } else { // clear package.loaded and _G + lua_getfield(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); lL_cleartable(L, lua_gettop(L)); - lua_pop(L, 1); // _LOADED + lua_pop(L, 1); // package.loaded lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS); lL_cleartable(L, lua_gettop(L)); lua_pop(L, 1); // _G -- cgit v1.2.3