diff options
Diffstat (limited to 'src/package.c')
| -rw-r--r-- | src/package.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/package.c b/src/package.c index 832e7da..98d6f00 100644 --- a/src/package.c +++ b/src/package.c @@ -36,11 +36,13 @@ int extract_package_info(lua_State *L, pow_package *pkg) { pkg->version = strdup(lua_tostring(L, -1)); + lua_pop(L, 1); + if (!pkg->version) { printf("strdup failed trying to get package name\n"); - } - pkg->pkg_ref = luaL_ref(L, LUA_REGISTRYINDEX); + return 1; + } return 0; } @@ -113,7 +115,9 @@ int pow_package_open(pow_package *pkg, const char *path) { } extract_package_info(L, pkg); + pkg->path = path; + pkg->pkg_ref = luaL_ref(L, LUA_REGISTRYINDEX); return 0; } |
