diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-07-07 10:32:52 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-07-07 10:32:52 -0300 |
| commit | 0ec4c473df871ce88d3c06f7a801c557cb7f9d86 (patch) | |
| tree | eccfdda877308ec52c45de046f6f111ffe70a735 | |
| parent | 9e05503ffaf915ea30cf349ad52eae9fe17db4fc (diff) | |
| download | lua-0ec4c473df871ce88d3c06f7a801c557cb7f9d86.tar.gz lua-0ec4c473df871ce88d3c06f7a801c557cb7f9d86.tar.bz2 lua-0ec4c473df871ce88d3c06f7a801c557cb7f9d86.zip | |
bug: file:close cannot be called without a file.
Diffstat (limited to '')
| -rw-r--r-- | liolib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 2.42 2003/05/14 19:03:43 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.43 2003/05/14 21:01:53 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 | */ |
| @@ -137,7 +137,7 @@ static int aux_close (lua_State *L) { | |||
| 137 | 137 | ||
| 138 | 138 | ||
| 139 | static int io_close (lua_State *L) { | 139 | static int io_close (lua_State *L) { |
| 140 | if (lua_isnone(L, 1)) | 140 | if (lua_isnone(L, 1) && lua_type(L, lua_upvalueindex(1)) == LUA_TTABLE) |
| 141 | lua_rawgeti(L, lua_upvalueindex(1), IO_OUTPUT); | 141 | lua_rawgeti(L, lua_upvalueindex(1), IO_OUTPUT); |
| 142 | return pushresult(L, aux_close(L), NULL); | 142 | return pushresult(L, aux_close(L), NULL); |
| 143 | } | 143 | } |
