diff options
| -rw-r--r-- | liolib.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -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; |
