Comparing version 1.1.4 to 1.1.5
@@ -11,3 +11,3 @@ { | ||
, "dependencies": {} | ||
, "version": "1.1.4" | ||
, "version": "1.1.5" | ||
, "repository": { | ||
@@ -14,0 +14,0 @@ "type": "git" |
@@ -28,3 +28,2 @@ /*! | ||
var urlutil = require('url'); | ||
var pathutil = require('path'); | ||
var requestURI = require('./request').requestURI; | ||
@@ -43,11 +42,13 @@ var requestURIs = require('./request').requestURIs; | ||
var rootSplit = rootPath.split('/'); | ||
var pathPart; | ||
var rootPart; | ||
while ((pathPart = pathSplit.shift()) == (rootPart = rootSplit.shift())) {;} | ||
return pathutil.join( | ||
(new Array(rootSplit.length+1)).join('../') | ||
, pathPart | ||
, pathSplit.join('/') | ||
); | ||
var relative; | ||
var i = 0; | ||
while (pathSplit[i] == rootSplit.shift[i]) { | ||
i++; | ||
} | ||
if (i < rootSplit.length - 1) { | ||
relative = (new Array((rootSplit.length - i) + 1)).join('../'); | ||
} else { | ||
relative = ''; // perhaps './'? | ||
} | ||
return relative + pathSplit.slice(i).join('/'); | ||
} | ||
@@ -54,0 +55,0 @@ |
347170
10334