From 064e406f67c0153999a5246deb1d616b06ee9bb0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 Mar 2010 17:58:11 -0300 Subject: no more fenvs! --- linit.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'linit.c') diff --git a/linit.c b/linit.c index 095a835a..79dec99f 100644 --- a/linit.c +++ b/linit.c @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.22 2009/12/17 12:26:09 roberto Exp roberto $ +** $Id: linit.c,v 1.23 2009/12/22 15:32:50 roberto Exp roberto $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ @@ -52,9 +52,9 @@ LUALIB_API void luaL_openlibs (lua_State *L) { const luaL_Reg *lib; /* call open functions from 'loadedlibs' */ for (lib = loadedlibs; lib->func; lib++) { - lua_pushcfunction(L, lib->func); + lua_settop(L, 0); lua_pushstring(L, lib->name); - lua_call(L, 1, 0); + (lib->func)(L); } /* add open functions from 'preloadedlibs' into 'package.preload' table */ lua_pushglobaltable(L); @@ -65,8 +65,7 @@ LUALIB_API void luaL_openlibs (lua_State *L) { } lua_pop(L, 1); /* remove package.preload table */ #if defined(LUA_COMPAT_DEBUGLIB) - lua_pushglobaltable(L); - lua_getfield(L, -1, "require"); + lua_getglobal(L, "require"); lua_pushliteral(L, LUA_DBLIBNAME); lua_call(L, 1, 0); /* call 'require"debug"' */ lua_pop(L, 1); /* remove global table */ -- cgit v1.2.3-55-g6feb