diff options
| author | ruki <[email protected]> | 2021-05-28 22:41:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-05-28 22:41:42 +0800 |
| commit | 1581e24742625d79eb79ab48bdeccfcb6580cab0 (patch) | |
| tree | 31a9fcc211af0ae3c1fb9c0de9a4c0c38f6a5896 /xmake/core/base/path.lua | |
| parent | 239c446b20ecceda838e0de77711be18805fab26 (diff) | |
improve os.match and path.pattern
Diffstat (limited to 'xmake/core/base/path.lua')
| -rw-r--r-- | xmake/core/base/path.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index 9da3f57c4..18dbc6b01 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -191,7 +191,11 @@ function path.pattern(pattern) pattern = pattern:gsub("%*%*", "\001") pattern = pattern:gsub("%*", "\002") pattern = pattern:gsub("\001", ".*") - pattern = pattern:gsub("\002", "[^/]*") + if path.sep() == '\\' then + pattern = pattern:gsub("\002", "[^/\\]*") + else + pattern = pattern:gsub("\002", "[^/]*") + end -- case-insensitive filesystem? if not os.fscase() then |
