From 5bea8b95e3857b250e98327140a580ef68a59d9c Mon Sep 17 00:00:00 2001 From: dacctal Date: Thu, 22 Oct 2026 15:00:26 +0000 Subject: added some bldit stuff, it's still broken though --- src/lua_state.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/lua_state.c') diff --git a/src/lua_state.c b/src/lua_state.c index 297a218..cf46760 100644 --- a/src/lua_state.c +++ b/src/lua_state.c @@ -62,6 +62,8 @@ bool init_lua_state(void) { } str_free(&lua_path); + lua_setglobal(L, "__pkgit_user_config"); + lua_pop(L, 1); L_is_loaded = true; return true; } @@ -94,10 +96,8 @@ static void setup_base_dirs(void) { } static bool load_init_lua(void) { - lua_setglobal(L, "__PkgitUserConfig"); - lua_getglobal(L, "__PkgitUserConfig"); - - lua_get_field_type("dirs", table, &config.init_path, 1); + lua_getglobal(L, "__pkgit_user_config"); + lua_get_field_type("dirs", table, &config.init_path, 2); #define X(field) \ do { \ @@ -114,20 +114,15 @@ static bool load_init_lua(void) { #undef X - lua_pop(L, 1); + lua_pop(L, 2); return true; } bool init_lua_config(void) { setup_base_dirs(); - - if (!init_lua_state()) - return false; - - if (!load_init_lua()) - return false; - + if (!init_lua_state()) return false; + if (!load_init_lua()) return false; return true; } -- cgit v1.2.3