aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-03 11:36:45 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-03 11:36:45 -0300
commite41fb9a60478d8598a93c235760621bf6468c2df (patch)
tree63f29492e8a1b292e2c85f00a097f9ca4e0d55fd
parent5fc92cce12348226f229dbc9d69fae8fb4cac9de (diff)
downloadlua-e41fb9a60478d8598a93c235760621bf6468c2df.tar.gz
lua-e41fb9a60478d8598a93c235760621bf6468c2df.tar.bz2
lua-e41fb9a60478d8598a93c235760621bf6468c2df.zip
registry._LOADED created "on demand"
-rw-r--r--lauxlib.c4
-rw-r--r--loadlib.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 07dcdb27..900f14b9 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -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 */
diff --git a/loadlib.c b/loadlib.c
index c97d25ed..5607897b 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loadlib.c,v 1.44 2005/09/06 17:20:25 roberto Exp roberto $ 2** $Id: loadlib.c,v 1.45 2005/09/30 13:50:05 roberto Exp roberto $
3** Dynamic library loader for Lua 3** Dynamic library loader for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5** 5**
@@ -640,7 +640,7 @@ LUALIB_API int luaopen_package (lua_State *L) {
640 LUA_EXECDIR "\n" LUA_IGMARK); 640 LUA_EXECDIR "\n" LUA_IGMARK);
641 lua_setfield(L, -2, "config"); 641 lua_setfield(L, -2, "config");
642 /* set field `loaded' */ 642 /* set field `loaded' */
643 lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); 643 luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED");
644 lua_setfield(L, -2, "loaded"); 644 lua_setfield(L, -2, "loaded");
645 /* set field `preload' */ 645 /* set field `preload' */
646 lua_newtable(L); 646 lua_newtable(L);