From 518be7f92e2c2bc1a3cc3cfe1223390ae3cd9c2b Mon Sep 17 00:00:00 2001 From: dacctal Date: Fri, 17 Jul 2026 23:12:40 +0000 Subject: update! --- src/pkg_exists.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pkg_exists.c') 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; } -- cgit v1.2.3