diff options
author | isaacs <i@izs.me> | 2013-02-06 20:24:46 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-02-06 20:24:46 +0400 |
commit | 191e693d64931854d910170c2c4372b3987fb24f (patch) | |
tree | f492d711ae1770dcaa79260c46bd2df59fb550a4 /node_modules/glob/glob.js | |
parent | bde04376baddc83d6131dfda8a7b9a7637d0d9e2 (diff) |
glob@3.1.19
Diffstat (limited to 'node_modules/glob/glob.js')
-rw-r--r-- | node_modules/glob/glob.js | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js index 0b73526d3..d241e7c4f 100644 --- a/node_modules/glob/glob.js +++ b/node_modules/glob/glob.js @@ -324,7 +324,13 @@ Glob.prototype._process = function (pattern, depth, index, cb_) { // nothing more to do, either way. if (exists) { if (prefix && isAbsolute(prefix) && !this.nomount) { - prefix = path.join(this.root, prefix) + if (prefix.charAt(0) === "/") { + console.error('JOIN 0', this.root, prefix) + prefix = path.join(this.root, prefix) + console.error('JOIN 1', this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + } } if (process.platform === "win32") @@ -357,15 +363,20 @@ Glob.prototype._process = function (pattern, depth, index, cb_) { var read if (prefix === null) read = "." else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { - if (!prefix || !isAbsolute(prefix)) + if (!prefix || !isAbsolute(prefix)) { + console.error('JOIN 1', "/", prefix) prefix = path.join("/", prefix) + console.error('JOIN 2', "/", prefix) + } read = prefix = path.resolve(prefix) - if (process.platform === "win32") - read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") + // if (process.platform === "win32") + // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") - this.log('absolute: ', prefix, this.root, pattern) - } else read = prefix + this.log('absolute: ', prefix, this.root, pattern, read) + } else { + read = prefix + } this.log('readdir(%j)', read, this.cwd, this.root) @@ -433,7 +444,9 @@ Glob.prototype._process = function (pattern, depth, index, cb_) { else e = prefix + e } if (e.charAt(0) === "/" && !this.nomount) { + console.error('JOIN 3', this.root, e) e = path.join(this.root, e) + console.error('JOIN 4', this.root, e) } if (process.platform === "win32") @@ -468,7 +481,9 @@ Glob.prototype._stat = function (f, cb) { assert(this instanceof Glob) var abs = f if (f.charAt(0) === "/") { + console.error('JOIN 5', this.root, f) abs = path.join(this.root, f) + console.error('JOIN 6', this.root, f) } else if (this.changedCwd) { abs = path.resolve(this.cwd, f) } @@ -526,7 +541,9 @@ Glob.prototype._readdir = function (f, cb) { assert(this instanceof Glob) var abs = f if (f.charAt(0) === "/") { + console.error('JOIN 5', this.root, f) abs = path.join(this.root, f) + console.error('JOIN 5', abs) } else if (isAbsolute(f)) { abs = f } else if (this.changedCwd) { |