diff --git a/minimatch.js b/minimatch.js index 90eacf6a..14b7e4bb 100644 --- a/minimatch.js +++ b/minimatch.js @@ -306,7 +306,7 @@ function parse (pattern, isSub) { if (pattern === '') return '' var re = '' - var hasMagic = false + var hasMagic = !!options.nocase var escaping = false // ? => one single character var patternListStack = [] @@ -891,11 +891,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // patterns with magic have been turned into regexps. var hit if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } + hit = f === p this.debug('string match', p, f, hit) } else { hit = f.match(p) diff --git a/test/patterns.js b/test/patterns.js index 4167b78f..ac79b439 100644 --- a/test/patterns.js +++ b/test/patterns.js @@ -330,7 +330,7 @@ module.exports.regexps = [ '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', '/^(?:\\[\\])$/', '/^(?:\\[abc)$/', - '/^(?:XYZ)$/i', + '/^(?:(?=.)XYZ)$/i', '/^(?:(?=.)ab[^/]*?)$/i', '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/',