From a139e2e003e0b62b7d34eeda20dd2354e74885f9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 30 Jun 2010 14:40:27 -0300 Subject: old (and complex) luaL_findtable now used only in compatibility code inside lauxlib.c --- linit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linit.c') diff --git a/linit.c b/linit.c index 99c33e92..6c803270 100644 --- a/linit.c +++ b/linit.c @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.25 2010/05/20 12:57:59 roberto Exp roberto $ +** $Id: linit.c,v 1.26 2010/06/10 21:29:47 roberto Exp roberto $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ @@ -59,7 +59,7 @@ LUALIB_API void luaL_openlibs (lua_State *L) { } /* add open functions from 'preloadedlibs' into 'package.preload' table */ lua_pushglobaltable(L); - luaL_findtable(L, 0, "package.preload", 0); + luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); for (lib = preloadedlibs; lib->func; lib++) { lua_pushcfunction(L, lib->func); lua_setfield(L, -2, lib->name); -- cgit v1.2.3-55-g6feb