summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-07-11 23:57:06 +0800
committerruki <[email protected]>2018-07-11 17:42:36 +0800
commit9bf2dfab4b53cb2b804bdb599b13b25e104d4b3f (patch)
tree610b335c94fb082eb1cd5b1b10f8c20b512e1b6b /xmake/core/base/os.lua
parent3365fc7ea36a050a3cfba771b78c48d44cb8a6e1 (diff)
improve find_path
Diffstat (limited to 'xmake/core/base/os.lua')
-rw-r--r--xmake/core/base/os.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 2cf56e3df..4820fa3a1 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -291,11 +291,7 @@ function os.match(pattern, mode, callback)
end
-- convert pattern to a lua pattern
- pattern = pattern:gsub("([%+%.%-%^%$%(%)%%])", "%%%1")
- pattern = pattern:gsub("%*%*", "\001")
- pattern = pattern:gsub("%*", "\002")
- pattern = pattern:gsub("\001", ".*")
- pattern = pattern:gsub("\002", "[^/]*")
+ pattern = path.pattern(pattern)
-- find it
return os.find(rootdir, pattern, recursion, mode, excludes, callback)