Fix unbalanced Lua stack operation (#1162)

Add a single "do" to the beginning of the config. This causes a parsing
error ("'end' expected") and then another warning saying "something was
left on the Lua stack.

Fix this by popping the error message where we need to do so.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-10-22 10:44:54 +02:00 committed by Daniel Hahler
parent 7292be1add
commit 0b17e5dac3
1 changed files with 1 additions and 0 deletions

1
luaa.c
View File

@ -782,6 +782,7 @@ luaA_loadrc(const char *confpath, bool run)
const char *err = lua_tostring(L, -1);
luaA_startup_error(err);
fprintf(stderr, "%s\n", err);
lua_pop(L, 1);
return false;
}