Skip to content

Commit 50e82fa

Browse files
committed
Properly handle multiple ../.. in path.normalize, see #688
1 parent 7c3506b commit 50e82fa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/path/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ path.normalize = function normalize(path) {
3333
prefix = parts.shift() + "/";
3434
for (var i = 0; i < parts.length;) {
3535
if (parts[i] === "..") {
36-
if (i > 0)
36+
if (i > 0 && parts[i - 1] !== "..")
3737
parts.splice(--i, 2);
3838
else if (absolute)
3939
parts.splice(i, 1);

lib/path/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@protobufjs/path",
33
"description": "A minimal path module to resolve Unix, Windows and URL paths alike.",
4-
"version": "1.1.1",
4+
"version": "1.1.2",
55
"author": "Daniel Wirtz <[email protected]>",
66
"repository": {
77
"type": "git",

0 commit comments

Comments
 (0)