aboutsummaryrefslogtreecommitdiff
path: root/linit.c
diff options
context:
space:
mode:
Diffstat (limited to 'linit.c')
-rw-r--r--linit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linit.c b/linit.c
index 79dec99f..2e9fb0b9 100644
--- a/linit.c
+++ b/linit.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: linit.c,v 1.23 2009/12/22 15:32:50 roberto Exp roberto $ 2** $Id: linit.c,v 1.24 2010/03/26 20:58:11 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_settop(L, 0); 55 lua_pushcfunction(L, lib->func);
56 lua_pushstring(L, lib->name); 56 lua_pushstring(L, lib->name);
57 (lib->func)(L); 57 lua_call(L, 1, 0);
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);