'luaL_findtable' -> 'luaL_getsubtable'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: loadlib.c,v 1.96 2011/02/07 19:15:24 roberto Exp roberto $
|
||||
** $Id: loadlib.c,v 1.97 2011/03/01 17:01:53 roberto Exp roberto $
|
||||
** Dynamic library loader for Lua
|
||||
** See Copyright Notice in lua.h
|
||||
**
|
||||
@@ -652,10 +652,10 @@ LUAMOD_API int luaopen_package (lua_State *L) {
|
||||
LUA_EXEC_DIR "\n" LUA_IGMARK "\n");
|
||||
lua_setfield(L, -2, "config");
|
||||
/* set field `loaded' */
|
||||
luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED");
|
||||
luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED");
|
||||
lua_setfield(L, -2, "loaded");
|
||||
/* set field `preload' */
|
||||
luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD");
|
||||
luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD");
|
||||
lua_setfield(L, -2, "preload");
|
||||
lua_pushglobaltable(L);
|
||||
lua_pushvalue(L, -2); /* set 'package' as upvalue for next lib */
|
||||
|
||||
Reference in New Issue
Block a user