fs::canonical should report an error on empty path
gulrak opened this issue · comments
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("").
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.