Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/path_translate.c')
-rw-r--r--src/host/path_translate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/host/path_translate.c b/src/host/path_translate.c
index 8996b37..bd0c2f1 100644
--- a/src/host/path_translate.c
+++ b/src/host/path_translate.c
@@ -43,12 +43,14 @@ int path_translate(lua_State* L)
lua_newtable(L);
lua_pushnil(L);
while (lua_next(L, 1)) {
- const char* value = luaL_checkstring(L, 4);
- translate(buffer, value, sep[0]);
- lua_pop(L, 1);
+ const char* key;
+ lua_pushvalue(L, 4); // copy the key
+ key = luaL_checkstring(L, 5);
+ translate(buffer, key, sep[0]);
+ lua_pop(L, 2);
lua_pushstring(L, buffer);
- lua_rawseti(L, -3, ++i);
+ lua_rawseti(L, -3, ++i);
}
return 1;
}