diff options
| author | ruki <[email protected]> | 2018-08-14 22:38:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-08-14 09:52:06 +0800 |
| commit | e5011cbbe2717c0fd07c4da2394f6ced07a3f6cc (patch) | |
| tree | c0259e6740ef07adb0d94a21656e5fca4a766cf8 /xmake/core/base/path.lua | |
| parent | 96de3aa701d92ceb2162d519d3ea9679c32f655a (diff) | |
case-insensitive for windows path
Diffstat (limited to 'xmake/core/base/path.lua')
| -rw-r--r-- | xmake/core/base/path.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua index 340d57b83..19189ee90 100644 --- a/xmake/core/base/path.lua +++ b/xmake/core/base/path.lua @@ -111,11 +111,18 @@ end -- convert path pattern to a lua pattern function path.pattern(pattern) + + -- translate wildcards, .e.g *, ** pattern = pattern:gsub("([%+%.%-%^%$%(%)%%])", "%%%1") pattern = pattern:gsub("%*%*", "\001") pattern = pattern:gsub("%*", "\002") pattern = pattern:gsub("\001", ".*") pattern = pattern:gsub("\002", "[^/]*") + + -- case-insensitive for windows path + if os.host() == "windows" then + pattern = string.ipattern(pattern, true) + end return pattern end |
