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

fs::canonical should report an error on empty path #1

Closed
gulrak opened this issue Sep 23, 2018 · 1 comment
Closed

fs::canonical should report an error on empty path #1

gulrak opened this issue Sep 23, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gulrak
Copy link
Owner

gulrak commented Sep 23, 2018

fs::canonical(...) must handle a non-existent path as an error. As fs::exists("") is false, it is wrong to return the current directory for fs::canonical("").

@gulrak gulrak added the bug Something isn't working label Sep 23, 2018
@gulrak gulrak self-assigned this Sep 23, 2018
@gulrak
Copy link
Owner Author

gulrak commented Sep 23, 2018

This change results in fs::weakly_canonical("notfound/foobar") returning fs::path("notfound/foobar"). Changing test results accordingly.

This breaks tests with std::filesystem::weakly_canonical on gcc 8.1.0 and clang 7.0.0, but is matching the results of VS 2017 15.8.5.

@gulrak gulrak closed this as completed in d097c95 Sep 23, 2018
GerHobbelt pushed a commit to GerHobbelt/filesystem that referenced this issue Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant