Skip to content

Commit 73feafd

Browse files
committed
update minimatch, use allowWindowsEscape:true option
1 parent 3bfec21 commit 73feafd

File tree

5 files changed

+1208
-1565
lines changed

5 files changed

+1208
-1565
lines changed

common.js

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ function setopts (self, pattern, options) {
110110
// Note that they are not supported in Glob itself anyway.
111111
options.nonegate = true
112112
options.nocomment = true
113+
// always treat \ in patterns as escapes, not path separators
114+
options.allowWindowsEscape = true
113115

114116
self.minimatch = new Minimatch(pattern, options)
115117
self.options = self.minimatch.options

glob.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
342342
var read
343343
if (prefix === null)
344344
read = '.'
345-
else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
345+
else if (isAbsolute(prefix) ||
346+
isAbsolute(pattern.map(function (p) {
347+
return typeof p === 'string' ? p : '[*]'
348+
}).join('/'))) {
346349
if (!prefix || !isAbsolute(prefix))
347350
prefix = '/' + prefix
348351
read = prefix

0 commit comments

Comments
 (0)