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

Comments

Projects
None yet
2 participants
@linluxiang

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 "..". 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 added a commit that referenced this issue Feb 23, 2017

@dcodeIO dcodeIO added the bug label Feb 23, 2017

@dcodeIO

This comment has been minimized.

Owner

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