|
|
@ -962,21 +962,21 @@ fs.realpathSync = function realpathSync(p, cache) { |
|
|
|
|
|
|
|
// read the link if it wasn't read before
|
|
|
|
// dev/ino always return 0 on windows, so skip the check.
|
|
|
|
var linkTarget; |
|
|
|
var linkTarget = null; |
|
|
|
if (!isWindows) { |
|
|
|
var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); |
|
|
|
if (seenLinks[id]) { |
|
|
|
if (seenLinks.hasOwnProperty(id)) { |
|
|
|
linkTarget = seenLinks[id]; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!linkTarget) { |
|
|
|
if (linkTarget === null) { |
|
|
|
fs.statSync(base); |
|
|
|
linkTarget = fs.readlinkSync(base); |
|
|
|
resolvedLink = pathModule.resolve(previous, linkTarget); |
|
|
|
// track this, if given a cache.
|
|
|
|
if (cache) cache[base] = resolvedLink; |
|
|
|
if (!isWindows) seenLinks[id] = linkTarget; |
|
|
|
} |
|
|
|
resolvedLink = pathModule.resolve(previous, linkTarget); |
|
|
|
// track this, if given a cache.
|
|
|
|
if (cache) cache[base] = resolvedLink; |
|
|
|
if (!isWindows) seenLinks[id] = linkTarget; |
|
|
|
} |
|
|
|
|
|
|
|
// resolve the link, then start over
|
|
|
@ -1071,7 +1071,7 @@ fs.realpath = function realpath(p, cache, cb) { |
|
|
|
// dev/ino always return 0 on windows, so skip the check.
|
|
|
|
if (!isWindows) { |
|
|
|
var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); |
|
|
|
if (seenLinks[id]) { |
|
|
|
if (seenLinks.hasOwnProperty(id)) { |
|
|
|
return gotTarget(null, seenLinks[id], base); |
|
|
|
} |
|
|
|
} |
|
|
|