summaryrefslogtreecommitdiff
path: root/xmake/core/base/os.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-28 22:41:42 +0800
committerruki <[email protected]>2021-05-28 22:41:42 +0800
commit1581e24742625d79eb79ab48bdeccfcb6580cab0 (patch)
tree31a9fcc211af0ae3c1fb9c0de9a4c0c38f6a5896 /xmake/core/base/os.lua
parent239c446b20ecceda838e0de77711be18805fab26 (diff)
improve os.match and path.pattern
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 e26ac9956..071db0dfa 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -270,11 +270,7 @@ function os.match(pattern, mode, callback)
local _excludes = {}
for _, exclude in ipairs(excludes) do
exclude = path.translate(exclude)
- exclude = exclude:gsub("([%+%.%-%^%$%(%)%%])", "%%%1")
- exclude = exclude:gsub("%*%*", "\001")
- exclude = exclude:gsub("%*", "\002")
- exclude = exclude:gsub("\001", ".*")
- exclude = exclude:gsub("\002", "[^/]*")
+ exclude = path.pattern(exclude)
table.insert(_excludes, exclude)
end
excludes = _excludes