summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-09 23:52:26 +0800
committerruki <[email protected]>2022-03-09 23:52:26 +0800
commitb839cf85148abac9cb0bff5af013bb6ac7203824 (patch)
treeda2279effa483b40e96233e1d371303bb124696d
parent0aca668c37f645f7b8cdac44d3fb236c8f34196b (diff)
fix dir
m---------core/src/tbox/tbox0
-rw-r--r--tests/modules/path/test.lua1
-rw-r--r--xmake/core/base/os.lua2
3 files changed, 2 insertions, 1 deletions
diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox
-Subproject da64671b833ba8a7a56d882b9e170388504b70d
+Subproject e823da4188ba5818d13febd05b1ac58a8eb0b61
diff --git a/tests/modules/path/test.lua b/tests/modules/path/test.lua
index 05a5a0b40..8954e64a3 100644
--- a/tests/modules/path/test.lua
+++ b/tests/modules/path/test.lua
@@ -37,6 +37,7 @@ end
function test_directory(t)
t:are_equal(path.directory(""), nil)
t:are_equal(path.directory("."), nil)
+ t:are_equal(path.directory("foo"), ".")
if is_host("windows") then
t:are_equal(path.directory("c:"), nil)
t:are_equal(path.directory("c:\\"), nil)
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 5fefd9ab5..03c51006b 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -364,7 +364,7 @@ function os.match(pattern, mode, callback)
if startpos then
rootdir = rootdir:sub(1, startpos - 1)
end
- rootdir = path.translate(rootdir)
+ rootdir = path.directory(rootdir .. "_")
-- compute the recursion level
--