summaryrefslogtreecommitdiffstats
path: root/lib/models
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-26 10:23:37 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-26 10:23:37 +0200
commit374ebd6f7a77bfbde00f5d1e730403afd86e018f (patch)
tree55b8a6caca567cc76a5cf9028ec6206fa4370207 /lib/models
parentab2ebefe2bb6dee75e064c1ad572749e3f8104d1 (diff)
downloadgitbook-374ebd6f7a77bfbde00f5d1e730403afd86e018f.zip
gitbook-374ebd6f7a77bfbde00f5d1e730403afd86e018f.tar.gz
gitbook-374ebd6f7a77bfbde00f5d1e730403afd86e018f.tar.bz2
Add mock fs and tests for it
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/fs.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/models/fs.js b/lib/models/fs.js
index c74f3cd..f124da8 100644
--- a/lib/models/fs.js
+++ b/lib/models/fs.js
@@ -46,7 +46,8 @@ FS.prototype.isInScope = function(filename) {
FS.prototype.resolve = function() {
var rootPath = this.getRoot();
var args = Array.prototype.slice.call(arguments);
- var filename = path.resolve.apply(path, [rootPath].concat(args));
+ var filename = path.join.apply(path, [rootPath].concat(args));
+ filename = path.normalize(filename);
if (!this.isInScope(filename)) {
throw error.FileOutOfScopeError({