aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-29 13:35:17 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-29 13:35:17 -0200
commitfa8c44b510c6b56a290c14bd5dba4c7caec53284 (patch)
tree7af4612ab278d1e20b20d4611d9f00e103c317f0 /ldo.c
parent3b6f8bfbe688fdd0f1c17bd023140804155624f3 (diff)
downloadlua-fa8c44b510c6b56a290c14bd5dba4c7caec53284.tar.gz
lua-fa8c44b510c6b56a290c14bd5dba4c7caec53284.tar.bz2
lua-fa8c44b510c6b56a290c14bd5dba4c7caec53284.zip
avoid the use of "reopen" (not that standard)
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ldo.c b/ldo.c
index c17385e4..9fb42be7 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.116 2001/01/24 15:45:33 roberto Exp roberto $ 2** $Id: ldo.c,v 1.117 2001/01/26 11:45:51 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -277,7 +277,8 @@ static int parse_file (lua_State *L, const char *filename) {
277 ungetc(c, f); 277 ungetc(c, f);
278 bin = (c == ID_CHUNK); 278 bin = (c == ID_CHUNK);
279 if (bin && f != stdin) { 279 if (bin && f != stdin) {
280 f = freopen(filename, "rb", f); /* set binary mode */ 280 fclose(f);
281 f = fopen(filename, "rb"); /* reopen in binary mode */
281 if (f == NULL) return LUA_ERRFILE; /* unable to reopen file */ 282 if (f == NULL) return LUA_ERRFILE; /* unable to reopen file */
282 } 283 }
283 lua_pushliteral(L, "@"); 284 lua_pushliteral(L, "@");