Created
March 1, 2012 16:16
-
-
Save isaacs/1950942 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff lib/utils/find-prefix.js | |
diff --git a/lib/utils/find-prefix.js b/lib/utils/find-prefix.js | |
index 320456c..bc2c959 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) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment