Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path.normalize cannot handle paths with more than two ".." #688

Closed
linluxiang opened this issue Feb 23, 2017 · 1 comment
Closed

path.normalize cannot handle paths with more than two ".." #688

linluxiang opened this issue Feb 23, 2017 · 1 comment
Labels

Comments

@linluxiang
Copy link

protobuf.js version: latest

The function path.normalize will remove all "../..". When it meets a path like "../../folder", it will return "folder". This behavior is totally incorrect.

Here is the the source code where it removes the double "..". https://github.com/dcodeIO/protobuf.js/blob/master/lib/path/index.js#L35

        if (parts[i] === "..") {
            if (i > 0)
                parts.splice(--i, 2);
            else if (absolute)
                parts.splice(i, 1);
            else
                ++i
<please provide a code snippet for reproduction>
pbjs ../../folder.proto
<please paste the stack trace of the error if applicable>
@dcodeIO
Copy link
Member

dcodeIO commented Feb 28, 2017

This should be fixed within v6.6.4. Feel free to reopen if there are still any issues!

@dcodeIO dcodeIO closed this as completed Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants