aboutsummaryrefslogtreecommitdiff
path: root/src/lua_globs.c
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-07-17 00:18:01 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-07-17 00:18:01 +0000
commit7019724ab5c818e18fb5ee61b6b14487c47da3ec (patch)
tree0a7d60563c56a75fcfe7ecdd66f21bdc420fc1fa /src/lua_globs.c
parent43e35385f741a3c48cf667fd55bc1175d1d2b927 (diff)
more features but memory leak
Diffstat (limited to 'src/lua_globs.c')
-rw-r--r--src/lua_globs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lua_globs.c b/src/lua_globs.c
index b14eb3a..5f333a4 100644
--- a/src/lua_globs.c
+++ b/src/lua_globs.c
@@ -61,7 +61,7 @@ void init_lua_state(void) {
}
if (file_exists(cfg.repos.data)) {
if (luaL_loadfile(L, cfg.repos.data) || lua_pcall(L, 0, 0, 0)) {
- log_warn("cannot load repository file: %s", lua_tostring(L, -1));
+ if (flags.verbose) log_warn("cannot load repository file: %s", lua_tostring(L, -1));
lua_pop(L, 1);
}
}
@@ -76,7 +76,7 @@ void init_bldit_state(void) {
luaL_openlibs(B);
if (luaL_loadfile(B, "bldit.lua") || lua_pcall(B, 0, 0, 0)) {
if (flags.verbose)
- log_warn("cannot run bldit: %s", lua_tostring(B, -1));
+ if (flags.verbose) log_warn("cannot run bldit: %s", lua_tostring(B, -1));
return;
}
lua_pushfstring(B, "%s", inst_dirs.prefix.data);
@@ -140,7 +140,7 @@ bool lua_try_function(lua_State *L, char *lua_file, char *fname) {
lua_isnt_type(fname, "function");
lua_pop(L, 1);
} else if (lua_pcall(L, 0, 1, 0) != LUA_OK) {
- log_warn(
+ if (flags.verbose) log_warn(
"%s: '%s' function borked: %s",
lua_file, fname, lua_tostring(L, -1)
);
@@ -148,7 +148,7 @@ bool lua_try_function(lua_State *L, char *lua_file, char *fname) {
return false;
}
if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) {
- log_warn(
+ if (flags.verbose) log_warn(
"%s: '%s' failed: %s",
lua_file, fname, lua_tostring(L, -1)
);
@@ -166,7 +166,6 @@ bool lua_try_table(lua_State *L, char *lua_file, char *tname) {
bldit_isnt_type(tname, "table");
else
lua_isnt_type(tname, "table");
- lua_pop(L, 1);
return false;
}
return true;