Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-03-01 20:17:44 +0400
committerisaacs <i@izs.me>2012-03-01 20:17:44 +0400
commitb708c1e5f9fd9be7f0daa6efe92461d5961c3215 (patch)
tree91b8cfde77cd47f806b7a8ae397eca66f0c3578c
parent417a81e7818c86303ad40aff458eef3bb8f70368 (diff)
Fix windows UNC busyloop in findPrefix
-rw-r--r--lib/utils/find-prefix.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/utils/find-prefix.js b/lib/utils/find-prefix.js
index 320456c7e..bc2c9598d 100644
--- a/lib/utils/find-prefix.js
+++ b/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)
})
}