diff options
| -rwxr-xr-x | core/src/xmake/os/find.c | 4 | ||||
| -rw-r--r-- | xmake/core/base/os.lua | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/core/src/xmake/os/find.c b/core/src/xmake/os/find.c index 4cca6605c..ea847f195 100755 --- a/core/src/xmake/os/find.c +++ b/core/src/xmake/os/find.c @@ -51,6 +51,10 @@ static tb_bool_t xm_os_find_walk(tb_char_t const* path, tb_file_info_t const* in tb_char_t const* pattern = (tb_char_t const*)tuple[1].cstr; tb_assert_and_check_return_val(pattern, tb_false); + // remove ./ for path + if (path[0] == '.' && (path[1] == '/' || path[1] == '\\')) + path = path + 2; + // the match mode tb_long_t mode = tuple[2].l; diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index 40527b587..f6e1463f0 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -200,11 +200,6 @@ function os.match(pattern, mode) pattern = pattern:gsub("\001", ".*") pattern = pattern:gsub("\002", "[^/]*") - -- patch "./" for matching ok if root directory is '.' - if rootdir == '.' then - pattern = "." .. path.seperator() .. pattern - end - -- translate mode if type(mode) == "string" then local modes = {a = -1, f = 0, d = 1} |
