diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-15 14:32:47 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-15 14:32:47 -0300 |
commit | 209602ac31512c9f201d11edca6fe7aa368b85a4 (patch) | |
tree | 878c569fdbae1e867ed420da8d0e2e54e7fe4c98 /inout.c | |
parent | 6251d889ca96dc9c3219f5908b706cd4ca053259 (diff) | |
download | lua-209602ac31512c9f201d11edca6fe7aa368b85a4.tar.gz lua-209602ac31512c9f201d11edca6fe7aa368b85a4.tar.bz2 lua-209602ac31512c9f201d11edca6fe7aa368b85a4.zip |
BUG: input file must be closed just after parser.
Diffstat (limited to 'inout.c')
-rw-r--r-- | inout.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.56 1997/04/06 14:08:08 roberto Exp roberto $"; | 8 | char *rcs_inout="$Id: inout.c,v 2.57 1997/04/06 14:14:27 roberto Exp roberto $"; |
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <string.h> | 11 | #include <string.h> |
@@ -68,8 +68,6 @@ FILE *lua_openfile (char *fn) | |||
68 | } | 68 | } |
69 | else | 69 | else |
70 | fp = fopen (fn, "r"); | 70 | fp = fopen (fn, "r"); |
71 | if (fp == NULL) | ||
72 | return NULL; | ||
73 | lua_parsedfile = luaI_createfixedstring(fn)->str; | 71 | lua_parsedfile = luaI_createfixedstring(fn)->str; |
74 | return fp; | 72 | return fp; |
75 | } | 73 | } |
@@ -79,11 +77,8 @@ FILE *lua_openfile (char *fn) | |||
79 | */ | 77 | */ |
80 | void lua_closefile (void) | 78 | void lua_closefile (void) |
81 | { | 79 | { |
82 | if (fp != NULL && fp != stdin) | 80 | if (fp != stdin) |
83 | { | 81 | fclose(fp); |
84 | fclose (fp); | ||
85 | fp = NULL; | ||
86 | } | ||
87 | } | 82 | } |
88 | 83 | ||
89 | /* | 84 | /* |