Skip to content

Incorrect handling of ../.. #11

@zmeyc

Description

@zmeyc

Describe the bug

With ../.. only 1 dir is unrolled.

To Reproduce

    const char *path = "ab/cd/ef/../../qw";
    ghc::filesystem::path srcPath = ghc::filesystem::u8path(path);
    std::string destPath = srcPath.lexically_normal().u8string();

Expected behavior
Should produce ab/qw, produces ab/cd/qw.

Attached is a test project.

filesystem_test.zip

UPD:

More test cases:

"\\/\\///\\/" produces //////, expected /.

"a/b/..\\//..///\\/../c\\\\/" produces a/b/c///, expected ../c/.

"a/b/../../../c" produces a/c, expected ../c.

"..a/b/..\\//..///\\/../c\\\\/" produces ..a/b/c///, expected ../c/.

Metadata

Metadata

Assignees

Labels

available on masterFix is done on master branch, issue closed on next releasebugSomething isn't workinghighSeverity: high

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions