summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/path-is-inside/lib/path-is-inside.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-03-19 09:25:40 -0700
committerisaacs <i@izs.me>2014-03-19 09:26:05 -0700
commita65c1aaf3afe21a34cae7b4ad266a6f2723704d1 (patch)
tree61e4c2a3b069f78d8ef5ae635a887cda13ec1c15 /deps/npm/node_modules/path-is-inside/lib/path-is-inside.js
parent43a29f53ca11ab48e1d1ef6b2a0e673ae43a42a0 (diff)
downloadnode-npm-1.4.6.tar.gz
npm: upgrade to 1.4.6npm-1.4.6
Diffstat (limited to 'deps/npm/node_modules/path-is-inside/lib/path-is-inside.js')
-rw-r--r--deps/npm/node_modules/path-is-inside/lib/path-is-inside.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/deps/npm/node_modules/path-is-inside/lib/path-is-inside.js b/deps/npm/node_modules/path-is-inside/lib/path-is-inside.js
index 5d1160e57..596dfd3b3 100644
--- a/deps/npm/node_modules/path-is-inside/lib/path-is-inside.js
+++ b/deps/npm/node_modules/path-is-inside/lib/path-is-inside.js
@@ -13,7 +13,11 @@ module.exports = function (thePath, potentialParent) {
potentialParent = potentialParent.toLowerCase();
}
- return thePath.indexOf(potentialParent) === 0;
+ return thePath.lastIndexOf(potentialParent, 0) === 0 &&
+ (
+ thePath[potentialParent.length] === path.sep ||
+ thePath[potentialParent.length] === undefined
+ );
};
function stripTrailingSep(thePath) {