aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-06-26 07:25:38 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-06-26 07:25:38 +0000
commitfd9f38ea42b04d23203c1d407d8c6f19d673264b (patch)
tree5fd137e3b722ac2a13ab49b0b54dab3c3f8fa1fd
parent13ba408ef3316958b7cf9d5c1cdd3c222b1425ad (diff)
fixed false positives on lua return values
-rw-r--r--src/create_pkg.c2
-rw-r--r--src/fetch_git.c2
-rw-r--r--src/fetch_src.c1
-rw-r--r--src/lua_state.c18
4 files changed, 12 insertions, 11 deletions
diff --git a/src/create_pkg.c b/src/create_pkg.c
index 0137dd7..cb35ad0 100644
--- a/src/create_pkg.c
+++ b/src/create_pkg.c
@@ -87,7 +87,7 @@ Pkg create_pkg(const char *arg) {
bool is_in_repos = false;
for (size_t i = 0; i < cached_repos_count; i++) {
- if (strcmp(arg, cached_repos[i].source_key) == 0) {
+ if (strcmp(new_arg, cached_repos[i].source_key) == 0) {
is_in_repos = true;
break;
}
diff --git a/src/fetch_git.c b/src/fetch_git.c
index d7d1741..f47b881 100644
--- a/src/fetch_git.c
+++ b/src/fetch_git.c
@@ -18,7 +18,7 @@ int fetch_git(Pkg pkg) {
close(nullfd);
}
}
- const char *argv[8];
+ const char *argv[10];
int i = 0;
argv[i++] = "git";
argv[i++] = "-c";
diff --git a/src/fetch_src.c b/src/fetch_src.c
index 55ce135..8646b1d 100644
--- a/src/fetch_src.c
+++ b/src/fetch_src.c
@@ -29,6 +29,7 @@ void fetch_src(Pkg pkg) {
if (file_exists(pkg.src)) {
if (is_verbose)
printf("%s %s already exists. deleting...\n", print_pkgit, pkg.src);
+ chdir("..");
nftw(pkg.src, remove_tree, 64, FTW_DEPTH | FTW_PHYS);
}
if (strcmp(pkg.url, "") == 0) {
diff --git a/src/lua_state.c b/src/lua_state.c
index 9751780..ed3f1cc 100644
--- a/src/lua_state.c
+++ b/src/lua_state.c
@@ -177,7 +177,7 @@ bool target_loop_build(
lua_pop(L, 3);
return false;
}
- if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) {
+ if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) {
printf(
"%s %s: 'targets.%s.build' failed: %s\n",
print_error, lua_file, target, lua_tostring(L, -1)
@@ -210,10 +210,10 @@ bool target_loop_install(lua_State *L, const char* lua_file, const char *target)
"%s %s: 'targets.%s.pre_install' function borked: %s\n",
print_warning, lua_file, target, lua_tostring(L, -1)
);
- if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) {
+ if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) {
printf(
- "%s %s: 'targets.%s.pre_install' failed: %s\n",
- print_error, lua_file, target, lua_tostring(L, -1)
+ "%s %s: 'targets.%s.pre_install' failed: %d\n",
+ print_error, lua_file, target, (int)lua_tonumber(L, -1)
);
return false;
}
@@ -236,10 +236,10 @@ bool target_loop_install(lua_State *L, const char* lua_file, const char *target)
lua_pop(L, 1);
return false;
}
- if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) {
+ if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) {
printf(
- "%s %s: 'targets.%s.install' failed: %s\n",
- print_error, lua_file, target, lua_tostring(L, -1)
+ "%s %s: 'targets.%s.install' failed: %d\n",
+ print_error, lua_file, target, (int)lua_tonumber(L, -1)
);
lua_pop(L, 1);
return false;
@@ -256,7 +256,7 @@ bool target_loop_install(lua_State *L, const char* lua_file, const char *target)
"%s %s: 'targets.%s.post_install' function borked: %s\n",
print_warning, lua_file, target, lua_tostring(L, -1)
);
- if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) {
+ if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) {
printf(
"%s %s: 'targets.%s.post_install' failed: %s\n",
print_error, lua_file, target, lua_tostring(L, -1)
@@ -294,7 +294,7 @@ bool target_loop_uninstall(lua_State *L, const char *lua_file, const char *targe
lua_pop(L, 1);
return false;
}
- if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) if (is_verbose) {
+ if ((int)lua_tonumber(L, -1) != 0) if (is_verbose) {
printf(
"%s %s: 'targets.%s.uninstall' failed: %s\n",
print_error, lua_file, target, lua_tostring(L, -1)