Skip to content

Commit

Permalink
update minimatch, use allowWindowsEscape:true option
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 13, 2022
1 parent 3bfec21 commit 73feafd
Show file tree
Hide file tree
Showing 5 changed files with 1,208 additions and 1,565 deletions.
2 changes: 2 additions & 0 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ function setopts (self, pattern, options) {
// Note that they are not supported in Glob itself anyway.
options.nonegate = true
options.nocomment = true
// always treat \ in patterns as escapes, not path separators
options.allowWindowsEscape = true

self.minimatch = new Minimatch(pattern, options)
self.options = self.minimatch.options
Expand Down
5 changes: 4 additions & 1 deletion glob.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,10 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
var read
if (prefix === null)
read = '.'
else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
else if (isAbsolute(prefix) ||
isAbsolute(pattern.map(function (p) {
return typeof p === 'string' ? p : '[*]'
}).join('/'))) {
if (!prefix || !isAbsolute(prefix))
prefix = '/' + prefix
read = prefix
Expand Down
Loading

0 comments on commit 73feafd

Please sign in to comment.