summaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-05-08 17:14:16 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-05-08 17:14:16 -0300
commit55e323190eda0aac78c4cd13ba70c7f13d6f248b (patch)
treea9db435f5fd1493e8f49dc6b0c25c22d8cc2c89c /liolib.c
parentfe8f4c06f1949851eccebf59afbe69f132ab40e8 (diff)
downloadlua-github-55e323190eda0aac78c4cd13ba70c7f13d6f248b.tar.gz
files should not be operated after fclose, even when fclose fails
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/liolib.c b/liolib.c
index 594bbebf..7c2d3147 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.71 2006/01/17 13:54:02 roberto Exp roberto $
+** $Id: liolib.c,v 2.72 2006/01/28 12:59:13 roberto Exp roberto $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -99,7 +99,7 @@ static FILE **newfile (lua_State *L) {
static int io_pclose (lua_State *L) {
FILE **p = topfile(L);
int ok = lua_pclose(L, *p);
- if (ok) *p = NULL;
+ *p = NULL;
return pushresult(L, ok, NULL);
}
@@ -107,7 +107,7 @@ static int io_pclose (lua_State *L) {
static int io_fclose (lua_State *L) {
FILE **p = topfile(L);
int ok = (fclose(*p) == 0);
- if (ok) *p = NULL;
+ *p = NULL;
return pushresult(L, ok, NULL);
}