diff options
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -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, "@"); |
