gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.
MIT License
1.31k stars 168 forks source link

Fix lexically_relative return when base path evaluates to *this #179

Closed vgeorgiev closed 4 months ago

vgeorgiev commented 4 months ago

Fix the return of lexally_relative when called with the following values:

"/a/b/c".lexally_relative("/a/b/c/d/..") == "."

The proposed change is based on the following line from the documentation:

"otherwise, if N = 0 and a == end() || a->empty(), returns path("."), "

gulrak commented 4 months ago

Nice find! Thank you for the contribution!