Permalink
Browse files

Slightly smarter internal test.

  • Loading branch information...
1 parent 9e98201 commit e5b14b155e8f2fc7d81f236137368a668d6333fa @cowboy committed Jul 20, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/glob.js
View
@@ -34,7 +34,7 @@ exports.glob = function(pattern, options) {
// The passed pattern, resolved to an absolute path.
var absPattern = normalize(path.resolve(base, pattern));
// Since path.resolve strips off trailing '/', add it back if necessary.
- if (/\/$/.test(pattern)) { absPattern += '/'; }
+ if (/\/$/.test(pattern) && !/\/$/.test(absPattern)) { absPattern += '/'; }
// Was pattern-as-specified already absolute?
var wasAbsolute = normalize(pattern) === absPattern;
// Instead of recursing from the base looking for files, start recursing at

0 comments on commit e5b14b1

Please sign in to comment.