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

linluxiang opened this Issue Feb 23, 2017 · 1 comment


None yet
2 participants

linluxiang commented Feb 23, 2017

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 "..".

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

dcodeIO added a commit that referenced this issue Feb 23, 2017

@dcodeIO dcodeIO added the bug label Feb 23, 2017


This comment has been minimized.


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 Feb 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment