aboutsummaryrefslogtreecommitdiff
path: root/linit.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-26 17:58:11 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-26 17:58:11 -0300
commit064e406f67c0153999a5246deb1d616b06ee9bb0 (patch)
treef4483ab6ad6d55484829a0d8a27b8afa1768a36e /linit.c
parent5c87f61e6b1567400d2bd8f452939bb948f16dda (diff)
downloadlua-064e406f67c0153999a5246deb1d616b06ee9bb0.tar.gz
lua-064e406f67c0153999a5246deb1d616b06ee9bb0.tar.bz2
lua-064e406f67c0153999a5246deb1d616b06ee9bb0.zip
no more fenvs!
Diffstat (limited to 'linit.c')
-rw-r--r--linit.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/linit.c b/linit.c
index 095a835a..79dec99f 100644
--- a/linit.c
+++ b/linit.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: linit.c,v 1.22 2009/12/17 12:26:09 roberto Exp roberto $ 2** $Id: linit.c,v 1.23 2009/12/22 15:32:50 roberto Exp roberto $
3** Initialization of libraries for lua.c and other clients 3** Initialization of libraries for lua.c and other clients
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -52,9 +52,9 @@ LUALIB_API void luaL_openlibs (lua_State *L) {
52 const luaL_Reg *lib; 52 const luaL_Reg *lib;
53 /* call open functions from 'loadedlibs' */ 53 /* call open functions from 'loadedlibs' */
54 for (lib = loadedlibs; lib->func; lib++) { 54 for (lib = loadedlibs; lib->func; lib++) {
55 lua_pushcfunction(L, lib->func); 55 lua_settop(L, 0);
56 lua_pushstring(L, lib->name); 56 lua_pushstring(L, lib->name);
57 lua_call(L, 1, 0); 57 (lib->func)(L);
58 } 58 }
59 /* add open functions from 'preloadedlibs' into 'package.preload' table */ 59 /* add open functions from 'preloadedlibs' into 'package.preload' table */
60 lua_pushglobaltable(L); 60 lua_pushglobaltable(L);
@@ -65,8 +65,7 @@ LUALIB_API void luaL_openlibs (lua_State *L) {
65 } 65 }
66 lua_pop(L, 1); /* remove package.preload table */ 66 lua_pop(L, 1); /* remove package.preload table */
67#if defined(LUA_COMPAT_DEBUGLIB) 67#if defined(LUA_COMPAT_DEBUGLIB)
68 lua_pushglobaltable(L); 68 lua_getglobal(L, "require");
69 lua_getfield(L, -1, "require");
70 lua_pushliteral(L, LUA_DBLIBNAME); 69 lua_pushliteral(L, LUA_DBLIBNAME);
71 lua_call(L, 1, 0); /* call 'require"debug"' */ 70 lua_call(L, 1, 0); /* call 'require"debug"' */
72 lua_pop(L, 1); /* remove global table */ 71 lua_pop(L, 1); /* remove global table */