diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-07-18 08:40:27 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-07-18 08:40:27 +0000 |
| commit | 45b6947f49e47a5aff2e2a93a1cca2bc913d869c (patch) | |
| tree | 20dabcac7f850932779fa43d866c3bfdb82c7b42 /src/lua_globs.c | |
| parent | 2375b4bf64ac43866860b85ff7411093eebf3080 (diff) | |
fix segfault in get_pkgsrc() with invalid str_fmt args
Diffstat (limited to 'src/lua_globs.c')
| -rw-r--r-- | src/lua_globs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lua_globs.c b/src/lua_globs.c index 00049b4..3f8ac2a 100644 --- a/src/lua_globs.c +++ b/src/lua_globs.c @@ -72,7 +72,6 @@ void init_lua_state(void) { config_loaded = true; } -// FIXME: ensure this is called ONCE for clarity void init_bldit_state(void) { if (B != NULL) return; @@ -85,7 +84,6 @@ void init_bldit_state(void) { } lua_pushfstring(B, "%s", inst_dirs.prefix.data); lua_setglobal(B, "prefix"); - lua_pop(B, 1); bldit_loaded = true; } @@ -126,11 +124,12 @@ void bldit_isnt_type(char *variable, char *type) { bool lua_try_function(lua_State *L, char *lua_file, char *fname) { lua_getfield(L, -1, fname); if (!lua_isfunction(L, -1)) { - if (strcmp(lua_file, "bldit.lua")) + if (!strcmp(lua_file, "bldit.lua")) bldit_isnt_type(fname, "function"); else lua_isnt_type(fname, "function"); lua_pop(L, 1); + return false; } else if (lua_pcall(L, 0, 1, 0) != LUA_OK) { if (flags.verbose) log_warn("%s: '%s' function borked: %s", lua_file, fname, |
