Fix indentation and add braces to silence empty while loop body compiler warning.

This commit is contained in:
harry 2023-01-21 11:41:55 -05:00
parent aad52488ac
commit 821e82a069
1 changed files with 2 additions and 2 deletions

View File

@ -567,14 +567,14 @@ LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {
c = getc(lf.f);
if (c == '#') { /* Unix exec. file? */
lf.extraline = 1;
while ((c = getc(lf.f)) != EOF && c != '\n') ; /* skip first line */
while ((c = getc(lf.f)) != EOF && c != '\n'){} ; /* skip first line */
if (c == '\n') c = getc(lf.f);
}
if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */
lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */
if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
/* skip eventual `#!...' */
while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]){} ;
lf.extraline = 0;
}
ungetc(c, lf.f);