-
Notifications
You must be signed in to change notification settings - Fork 178
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
Incorrect handling of ../.. #11
Comments
The testcase "ab/cd/ef/../../qw" is indeed wrong, and indeed sequences of ".." are handled wrong. Sadly I didn't have one of those in my tests. Concerning the additional cases what is the operating system, this is run? The bash.sh looked like Linux but the backslashes look like Windows? |
Sorry, I forgot that I had an extra step replacing \ with / in additional test cases.
Output:
|
FIxed on master, will be part of the upcomming bugfix release v1.1.2 |
Awesome, thank you!
These should probably have backslashes on Windows if compatibility with std::filesystem is needed? I.e. |
You are very wellcome! Actually no need to use backslashes on the right hand side, as lexically_normal() returns an fs::path and the operator==(path, path) that is triggered will lead to implicit conversion of the right hand side string to a fs::path, so the actual comparison is on path level, working with ghc::filesystem and with MSVCs C++17 implementation of std::filesystem, and I ran the tests against both locally before closing the issue. |
Released with v1.1.2 |
Describe the bug
With
../..
only 1 dir is unrolled.To Reproduce
Expected behavior
Should produce
ab/qw
, producesab/cd/qw
.Attached is a test project.
filesystem_test.zip
UPD:
More test cases:
"\\/\\///\\/"
produces//////
, expected/
."a/b/..\\//..///\\/../c\\\\/"
producesa/b/c///
, expected../c/
."a/b/../../../c"
producesa/c
, expected../c
."..a/b/..\\//..///\\/../c\\\\/"
produces..a/b/c///
, expected../c/
.The text was updated successfully, but these errors were encountered: