summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-05-20 21:41:02 +0200
committerSamy Pessé <samypesse@gmail.com>2016-05-20 21:41:02 +0200
commit484a306adb8b6413d6a342aba8d3814ba6c4dc50 (patch)
treeaeb6506705cfc43b47b4c28ed408539bbc19836f
parent5bfc9f2f5604740fdbc24f4fbecc17834d430eda (diff)
downloadgitbook-484a306adb8b6413d6a342aba8d3814ba6c4dc50.zip
gitbook-484a306adb8b6413d6a342aba8d3814ba6c4dc50.tar.gz
gitbook-484a306adb8b6413d6a342aba8d3814ba6c4dc50.tar.bz2
Fix error with isInRoot when empty root
-rw-r--r--lib/utils/path.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils/path.js b/lib/utils/path.js
index f65d1b2..26b6005 100644
--- a/lib/utils/path.js
+++ b/lib/utils/path.js
@@ -11,6 +11,9 @@ function isInRoot(root, filename) {
root = path.normalize(root);
filename = path.normalize(filename);
+ if (root === '.') {
+ return true;
+ }
if (root[root.length - 1] != path.sep) {
root = root + path.sep;
}