summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-11-25 17:27:03 +0800
committerruki <[email protected]>2015-11-25 17:27:03 +0800
commitc8e83565addad6ca85d9a6c0386dae52409791cc (patch)
tree5405f1d7b5c7e96c86eb783459762e72e757bdd2 /xmake/scripts/base/os.lua
parent18ed559e87dc28b2e0ccd28443e1bf848c350ed1 (diff)
fix os.match bug
Diffstat (limited to 'xmake/scripts/base/os.lua')
-rw-r--r--xmake/scripts/base/os.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/scripts/base/os.lua b/xmake/scripts/base/os.lua
index c699bf95a..442ee20e4 100644
--- a/xmake/scripts/base/os.lua
+++ b/xmake/scripts/base/os.lua
@@ -84,6 +84,11 @@ function os.match(pattern, findir)
pattern = pattern:gsub("%*", "\002")
pattern = pattern:gsub("\001", ".*")
pattern = pattern:gsub("\002", "[^/]*")
+
+ -- patch "./" for matching ok if root directory is '.'
+ if rootdir == '.' then
+ pattern = "./" .. pattern
+ end
-- find it
return os.find(rootdir, pattern, recurse, findir, excludes)