Skip to content

Commit 84954fa

Browse files
committed
Correct misleading indentation.
It is clear that the intention was to run `lua_addvalue()` only if there is no error because lua_error() “never returns” ← `load81/lua/doc/manual.html#luaL_error`
1 parent 6af95e8 commit 84954fa

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lua/src/lauxlib.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {
574574
lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */
575575
if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
576576
/* skip eventual `#!...' */
577-
while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
577+
while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
578578
lf.extraline = 0;
579579
}
580580
ungetc(c, lf.f);
@@ -649,4 +649,3 @@ LUALIB_API lua_State *luaL_newstate (void) {
649649
if (L) lua_atpanic(L, &panic);
650650
return L;
651651
}
652-

lua/src/ltablib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ static int tremove (lua_State *L) {
134134

135135
static void addfield (lua_State *L, luaL_Buffer *b, int i) {
136136
lua_rawgeti(L, 1, i);
137-
if (!lua_isstring(L, -1))
137+
if (!lua_isstring(L, -1)) {
138138
luaL_error(L, "invalid value (%s) at index %d in table for "
139-
LUA_QL("concat"), luaL_typename(L, -1), i);
140-
luaL_addvalue(b);
139+
LUA_QL("concat"), luaL_typename(L, -1), i);
140+
}
141+
luaL_addvalue(b);
141142
}
142143

143144

@@ -284,4 +285,3 @@ LUALIB_API int luaopen_table (lua_State *L) {
284285
luaL_register(L, LUA_TABLIBNAME, tab_funcs);
285286
return 1;
286287
}
287-

0 commit comments

Comments
 (0)