diff options
Diffstat (limited to 'linit.c')
| -rw-r--r-- | linit.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: linit.c,v 1.7 2004/07/09 14:29:29 roberto Exp roberto $ | 2 | ** $Id: linit.c,v 1.8 2004/07/09 15:47:48 roberto Exp roberto $ |
| 3 | ** Initialization of libraries for lua.c | 3 | ** Initialization of libraries for lua.c |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -32,6 +32,8 @@ LUALIB_API int luaopen_stdlibs (lua_State *L) { | |||
| 32 | for (; lib->func; lib++) { | 32 | for (; lib->func; lib++) { |
| 33 | lib->func(L); /* open library */ | 33 | lib->func(L); /* open library */ |
| 34 | lua_settop(L, 0); /* discard any results */ | 34 | lua_settop(L, 0); /* discard any results */ |
| 35 | lua_pushvalue(L, LUA_GLOBALSINDEX); | ||
| 36 | lua_replace(L, LUA_ENVIRONINDEX); /* restore environment */ | ||
| 35 | } | 37 | } |
| 36 | return 0; | 38 | return 0; |
| 37 | } | 39 | } |
