diff options
| author | Lua Team <team@lua.org> | 2006-01-12 12:00:00 +0000 |
|---|---|---|
| committer | repogen <> | 2006-01-12 12:00:00 +0000 |
| commit | 4f266285f998d0d14c4e83cc29772f0de1a7fbba (patch) | |
| tree | a122a829730d9f96e3a4e2bf65347490a8759800 /src/liolib.c | |
| parent | b3196343ba1a5dfe10e68eb9c61dc0ad5bb961a8 (diff) | |
| download | lua-github-4f266285f998d0d14c4e83cc29772f0de1a7fbba.tar.gz | |
Lua 5.1-rc15.1-rc1
Diffstat (limited to 'src/liolib.c')
| -rw-r--r-- | src/liolib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liolib.c b/src/liolib.c index cc493aff..f0a7602a 100644 --- a/src/liolib.c +++ b/src/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.69 2005/10/19 13:05:11 roberto Exp $ +** $Id: liolib.c,v 2.70 2005/12/29 15:32:11 roberto Exp $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -507,8 +507,8 @@ static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { LUALIB_API int luaopen_io (lua_State *L) { createmeta(L); - /* create new (private) environment */ - lua_newtable(L); + /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */ + lua_createtable(L, 2, 1); lua_replace(L, LUA_ENVIRONINDEX); /* open library */ luaL_register(L, LUA_IOLIBNAME, iolib); @@ -518,7 +518,7 @@ LUALIB_API int luaopen_io (lua_State *L) { createstdfile(L, stderr, 0, "stderr"); /* create environment for 'popen' */ lua_getfield(L, -1, "popen"); - lua_newtable(L); + lua_createtable(L, 0, 1); lua_pushcfunction(L, io_pclose); lua_setfield(L, -2, "__close"); lua_setfenv(L, -2); |
