Skip to content

Commit

Permalink
Properly handle multiple ../.. in path.normalize, see #688
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Feb 23, 2017
1 parent 7c3506b commit 50e82fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/path/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ path.normalize = function normalize(path) {
prefix = parts.shift() + "/";
for (var i = 0; i < parts.length;) {
if (parts[i] === "..") {
if (i > 0)
if (i > 0 && parts[i - 1] !== "..")
parts.splice(--i, 2);
else if (absolute)
parts.splice(i, 1);
Expand Down
2 changes: 1 addition & 1 deletion lib/path/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@protobufjs/path",
"description": "A minimal path module to resolve Unix, Windows and URL paths alike.",
"version": "1.1.1",
"version": "1.1.2",
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
"repository": {
"type": "git",
Expand Down

0 comments on commit 50e82fa

Please sign in to comment.