equal
deleted
inserted
replaced
572 } |
572 } |
573 if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ |
573 if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ |
574 lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ |
574 lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ |
575 if (lf.f == NULL) return errfile(L, "reopen", fnameindex); |
575 if (lf.f == NULL) return errfile(L, "reopen", fnameindex); |
576 /* skip eventual `#!...' */ |
576 /* skip eventual `#!...' */ |
577 while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; |
577 while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) |
|
578 /* do nothing */ ; |
578 lf.extraline = 0; |
579 lf.extraline = 0; |
579 } |
580 } |
580 ungetc(c, lf.f); |
581 ungetc(c, lf.f); |
581 status = lua_load(L, getF, &lf, lua_tostring(L, -1)); |
582 status = lua_load(L, getF, &lf, lua_tostring(L, -1)); |
582 readstatus = ferror(lf.f); |
583 readstatus = ferror(lf.f); |