Fix PathUtils.isInRoot on windows

This commit is contained in:
Samy Pessé
2016-05-20 21:37:22 +02:00
parent 86a65e5287
commit 5bfc9f2f56
+6
View File
@@ -8,7 +8,13 @@ function normalizePath(filename) {
// Return true if file path is inside a folder
function isInRoot(root, filename) {
root = path.normalize(root);
filename = path.normalize(filename);
if (root[root.length - 1] != path.sep) {
root = root + path.sep;
}
return (filename.substr(0, root.length) === root);
}