diff options
| author | Lua Team <team@lua.org> | 2005-03-04 12:00:00 +0000 |
|---|---|---|
| committer | repogen <> | 2005-03-04 12:00:00 +0000 |
| commit | e6ddfd3b09c0a3727afc773029c323a3defe50fa (patch) | |
| tree | 70e021a2b008f43064eeb04e002a31ba371b5108 /src/linit.c | |
| parent | e2493a40ee611d5a718fd2a81fe67e24c04c91a0 (diff) | |
| download | lua-github-5.1-work5.tar.gz | |
Lua 5.1-work55.1-work5
Diffstat (limited to 'src/linit.c')
| -rw-r--r-- | src/linit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/linit.c b/src/linit.c index 0d5f9cd4..24f70edb 100644 --- a/src/linit.c +++ b/src/linit.c @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.8 2004/07/09 15:47:48 roberto Exp $ +** $Id: linit.c,v 1.9 2005/02/18 12:40:02 roberto Exp $ ** Initialization of libraries for lua.c ** See Copyright Notice in lua.h */ @@ -32,6 +32,8 @@ LUALIB_API int luaopen_stdlibs (lua_State *L) { for (; lib->func; lib++) { lib->func(L); /* open library */ lua_settop(L, 0); /* discard any results */ + lua_pushvalue(L, LUA_GLOBALSINDEX); + lua_replace(L, LUA_ENVIRONINDEX); /* restore environment */ } return 0; } |
