diff options
Diffstat (limited to 'deps/npm/lib/utils/find-prefix.js')
-rw-r--r-- | deps/npm/lib/utils/find-prefix.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/deps/npm/lib/utils/find-prefix.js b/deps/npm/lib/utils/find-prefix.js index 320456c7e..bc2c9598d 100644 --- a/deps/npm/lib/utils/find-prefix.js +++ b/deps/npm/lib/utils/find-prefix.js @@ -45,6 +45,9 @@ function findPrefix_ (p, original, cb) { return cb(null, p) } - return findPrefix_(path.dirname(p), original, cb) + var d = path.dirname(p) + if (d === p) return cb(null, original) + + return findPrefix_(d, original, cb) }) } |