Fix logic for absolute/relative argv[0] when constructing executable path.

Do not call path_isabsolute() in condition -- it always returns 1 and modifies the stack.
If argv[0] is already absolute, push it in the stack alone.
This commit is contained in:
Lauri Nurmi 2018-04-25 22:54:21 +03:00
parent 8d0dce9c65
commit 3556135a56

View File

@ -419,11 +419,12 @@ int premake_locate_executable(lua_State* L, const char* argv0)
lua_pushstring(L, "/");
lua_pushstring(L, argv0);
if (!path_isabsolute(L)) {
if (!do_isabsolute(argv0)) {
lua_concat(L, 3);
}
else {
lua_pop(L, 1);
lua_pop(L, 3);
lua_pushstring(L, argv0);
}
path = lua_tostring(L, -1);