diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-05-20 21:41:02 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-05-20 21:41:02 +0200 |
commit | 484a306adb8b6413d6a342aba8d3814ba6c4dc50 (patch) | |
tree | aeb6506705cfc43b47b4c28ed408539bbc19836f | |
parent | 5bfc9f2f5604740fdbc24f4fbecc17834d430eda (diff) | |
download | gitbook-484a306adb8b6413d6a342aba8d3814ba6c4dc50.zip gitbook-484a306adb8b6413d6a342aba8d3814ba6c4dc50.tar.gz gitbook-484a306adb8b6413d6a342aba8d3814ba6c4dc50.tar.bz2 |
Fix error with isInRoot when empty root
-rw-r--r-- | lib/utils/path.js | 3 |
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; } |