diff options
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.210 2010/05/12 14:09:20 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.211 2010/05/17 18:30:27 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -531,6 +531,7 @@ LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { | |||
531 | else if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ | 531 | else if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ |
532 | lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ | 532 | lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ |
533 | if (lf.f == NULL) return errfile(L, "reopen", fnameindex); | 533 | if (lf.f == NULL) return errfile(L, "reopen", fnameindex); |
534 | c = getc(lf.f); /* re-read first character */ | ||
534 | } | 535 | } |
535 | lf.first = c; /* 'c' is the first character of the stream */ | 536 | lf.first = c; /* 'c' is the first character of the stream */ |
536 | status = lua_load(L, getF, &lf, lua_tostring(L, -1)); | 537 | status = lua_load(L, getF, &lf, lua_tostring(L, -1)); |