From 01afb1c8e997a4ce98bf107393101ea4cbb7e26b Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 10 Mar 2022 00:54:46 +0800 Subject: improve path.translate --- core/src/tbox/tbox | 2 +- core/src/xmake/path/translate.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'core/src') diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox index 19a1e5652..1c62c6d02 160000 --- a/core/src/tbox/tbox +++ b/core/src/tbox/tbox @@ -1 +1 @@ -Subproject commit 19a1e565216e9797c3c145d2db176d54c27991ca +Subproject commit 1c62c6d02cc76681e715dbfdb755901379942c22 diff --git a/core/src/xmake/path/translate.c b/core/src/xmake/path/translate.c index 87059c85c..3074c0b2a 100644 --- a/core/src/xmake/path/translate.c +++ b/core/src/xmake/path/translate.c @@ -43,20 +43,20 @@ tb_int_t xm_path_translate(lua_State* lua) tb_char_t const* path = luaL_checklstring(lua, 1, &path_size); tb_check_return_val(path, 0); - // get the option argument, e.g. {reduce_dot2 = true} - tb_bool_t reduce_dot2 = tb_false; + // get the option argument, e.g. {normalize = true} + tb_bool_t normalize = tb_false; if (lua_istable(lua, 2)) { - lua_pushstring(lua, "reduce_dot2"); + lua_pushstring(lua, "normalize"); lua_gettable(lua, 2); if (lua_toboolean(lua, -1)) - reduce_dot2 = tb_true; + normalize = tb_true; lua_pop(lua, 1); } // do path:translate() tb_char_t data[TB_PATH_MAXN]; - tb_size_t size = tb_path_translate_to(path, (tb_size_t)path_size, data, sizeof(data), reduce_dot2); + tb_size_t size = tb_path_translate_to(path, (tb_size_t)path_size, data, sizeof(data), normalize); if (size) lua_pushlstring(lua, data, (size_t)size); else lua_pushnil(lua); return 1; -- cgit v1.3.1