diff options
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.151 2005/08/26 17:36:32 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.152 2005/09/06 17:20:11 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -231,7 +231,7 @@ LUALIB_API void luaI_openlib (lua_State *L, const char *libname, | |||
231 | const luaL_Reg *l, int nup) { | 231 | const luaL_Reg *l, int nup) { |
232 | if (libname) { | 232 | if (libname) { |
233 | /* check whether lib already exists */ | 233 | /* check whether lib already exists */ |
234 | lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); | 234 | luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED"); |
235 | lua_getfield(L, -1, libname); /* get _LOADED[libname] */ | 235 | lua_getfield(L, -1, libname); /* get _LOADED[libname] */ |
236 | if (!lua_istable(L, -1)) { /* not found? */ | 236 | if (!lua_istable(L, -1)) { /* not found? */ |
237 | lua_pop(L, 1); /* remove previous result */ | 237 | lua_pop(L, 1); /* remove previous result */ |