diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.136 2001/06/08 19:00:57 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.137 2001/07/12 19:34:03 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 | */ |
@@ -243,7 +243,7 @@ LUA_API int lua_loadfile (lua_State *L, const l_char *filename) { | |||
243 | int nlevel; /* level on the stack of filename */ | 243 | int nlevel; /* level on the stack of filename */ |
244 | FILE *f = (filename == NULL) ? stdin : fopen(filename, l_s("r")); | 244 | FILE *f = (filename == NULL) ? stdin : fopen(filename, l_s("r")); |
245 | if (f == NULL) return LUA_ERRFILE; /* unable to open file */ | 245 | if (f == NULL) return LUA_ERRFILE; /* unable to open file */ |
246 | bin = (ungetc(fgetc(f), f) == LUA_SIGNATURE[0]); | 246 | bin = (ungetc(getc(f), f) == LUA_SIGNATURE[0]); |
247 | if (bin && f != stdin) { | 247 | if (bin && f != stdin) { |
248 | fclose(f); | 248 | fclose(f); |
249 | f = fopen(filename, l_s("rb")); /* reopen in binary mode */ | 249 | f = fopen(filename, l_s("rb")); /* reopen in binary mode */ |