diff options
| author | forever2k38 <forever2k38@forever2k38.net> | 2026-10-13 22:10:24 +0200 |
|---|---|---|
| committer | forever2k38 <forever2k38@forever2k38.net> | 2026-10-13 22:10:24 +0200 |
| commit | 8781a6d4f9d5840c7c9954706c972564bd40e76e (patch) | |
| tree | 74e49fc74bb14fd8a390a2323b06f7fdd8ac40d1 /src/package.c | |
| parent | 63f6adddc8b2098daf223be85e79f74c07db3ad4 (diff) | |
feat: copy build config instead of just makeopts
Diffstat (limited to 'src/package.c')
| -rw-r--r-- | src/package.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/package.c b/src/package.c index 76216c7..2a947c0 100644 --- a/src/package.c +++ b/src/package.c @@ -167,7 +167,7 @@ int pow_extract_package_info(lua_State *L, pow_package *pkg) { return 0; } -int pow_package_open(pow_package *pkg, pow_config *cfg, const char *path) { +int pow_package_open(lua_State *L_global, pow_package *pkg, pow_config *cfg, const char *path) { FILE *fp; int c; int err; @@ -212,10 +212,12 @@ int pow_package_open(pow_package *pkg, pow_config *cfg, const char *path) { package_buffer[total] = '\0'; - lua_State *L = luaL_newstate(); + lua_State *L = lua_newthread(L_global); pkg->L = L; + // push the config object from cfg thread to pkg thread + luaL_openlibs(L); pow_lua_load(L, cfg); |
