aboutsummaryrefslogtreecommitdiff
path: root/src/pkg_exists.c
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-07-17 23:12:40 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-07-17 23:12:40 +0000
commit518be7f92e2c2bc1a3cc3cfe1223390ae3cd9c2b (patch)
tree0541433f4bc62cd9032bfe881fdbb212360da077 /src/pkg_exists.c
parent76ee567986a12c22e6a606d74e31425facf9f5f4 (diff)
update!
Diffstat (limited to 'src/pkg_exists.c')
-rw-r--r--src/pkg_exists.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pkg_exists.c b/src/pkg_exists.c
index 05aa238..3ff761a 100644
--- a/src/pkg_exists.c
+++ b/src/pkg_exists.c
@@ -1,8 +1,7 @@
/*
pkgit - package it!
-
- Copyright (C) 2026 dacctal
+Copyright (C) 2026 dacctal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
@@ -27,7 +26,10 @@ bool pkg_exists(str *name) {
lua_pop(L, 1);
return false;
}
- if (!lua_try_table(L, "init.lua", name->data)) {
+ str_slc new_name = {name->data, name->len};
+ char* name_cstr = (char*)new_name.data;
+ name_cstr[new_name.len] = '\0';
+ if (!lua_try_table(L, "init.lua", name_cstr)) {
lua_pop(L, 2);
return false;
}