summaryrefslogtreecommitdiff
path: root/src/lib/liolib.c
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2003-11-25 12:00:00 +0000
committerrepogen <>2003-11-25 12:00:00 +0000
commit72286a8eeb927e1a33f24e9d99bb37ec5343ad45 (patch)
tree5a325cc1666ee447433fd4a565ec7f12be57f00f /src/lib/liolib.c
parentf0e4e22f5c119865eb5a8d3844a40df2d5980b3b (diff)
downloadlua-github-5.0.1.tar.gz
Lua 5.0.15.0.1
Diffstat (limited to 'src/lib/liolib.c')
-rw-r--r--src/lib/liolib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/liolib.c b/src/lib/liolib.c
index 14bd7d99..96b38831 100644
--- a/src/lib/liolib.c
+++ b/src/lib/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.39 2003/03/19 21:16:12 roberto Exp $
+** $Id: liolib.c,v 2.39a 2003/03/19 21:16:12 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -158,7 +158,7 @@ static int aux_close (lua_State *L) {
static int io_close (lua_State *L) {
- if (lua_isnone(L, 1)) {
+ if (lua_isnone(L, 1) && lua_type(L, lua_upvalueindex(1)) == LUA_TTABLE) {
lua_pushstring(L, IO_OUTPUT);
lua_rawget(L, lua_upvalueindex(1));
}
@@ -175,7 +175,7 @@ static int io_gc (lua_State *L) {
static int io_tostring (lua_State *L) {
- char buff[32];
+ char buff[128];
FILE **f = topfile(L, 1);
if (*f == NULL)
strcpy(buff, "closed");