aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-31 10:30:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-08-31 10:30:10 -0300
commit10b4799ce57100545cd27bc7c7b2fd83c6c30ab8 (patch)
tree5c940c7e2d023b48a5406a18714b6ed7339747fc /liolib.c
parenta0de89d62a71b944e56264ec948e01cad12d5602 (diff)
downloadlua-10b4799ce57100545cd27bc7c7b2fd83c6c30ab8.tar.gz
lua-10b4799ce57100545cd27bc7c7b2fd83c6c30ab8.tar.bz2
lua-10b4799ce57100545cd27bc7c7b2fd83c6c30ab8.zip
details
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/liolib.c b/liolib.c
index 0a310de0..33a15a81 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.73 2000/08/29 14:33:31 roberto Exp roberto $ 2** $Id: liolib.c,v 1.74 2000/08/29 20:43:28 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -159,7 +159,7 @@ static int file_collect (lua_State *L) {
159 IOCtrl *ctrl = (IOCtrl *)lua_touserdata(L, -1); 159 IOCtrl *ctrl = (IOCtrl *)lua_touserdata(L, -1);
160 lua_settop(L, -1); /* remove upvalue */ 160 lua_settop(L, -1); /* remove upvalue */
161 if (ctrl == (IOCtrl *)lua_touserdata(L, 1)) { 161 if (ctrl == (IOCtrl *)lua_touserdata(L, 1)) {
162 /* collectig `ctrl' itself */ 162 /* collecting `ctrl' itself */
163 lua_unref(L, ctrl->ref[INFILE]); 163 lua_unref(L, ctrl->ref[INFILE]);
164 lua_unref(L, ctrl->ref[OUTFILE]); 164 lua_unref(L, ctrl->ref[OUTFILE]);
165 free(ctrl); 165 free(ctrl);
@@ -372,7 +372,8 @@ static int io_read (lua_State *L) {
372 firstarg = lastarg = 1; /* correct indices */ 372 firstarg = lastarg = 1; /* correct indices */
373 lua_pushstring(L, "*l"); /* push default argument */ 373 lua_pushstring(L, "*l"); /* push default argument */
374 } 374 }
375 luaL_checkstack(L, lastarg-firstarg+1, "too many results"); 375 else
376 luaL_checkstack(L, lastarg-firstarg+1, "too many arguments");
376 for (n = firstarg; n<=lastarg; n++) { 377 for (n = firstarg; n<=lastarg; n++) {
377 size_t l; 378 size_t l;
378 int success; 379 int success;