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.34k stars 173 forks source link

lexically_relative should ignore trailing slash on base #56

Closed ligfx closed 4 years ago

ligfx commented 4 years ago

Expected behavior

fs::path("a/b").lexically_relative("a") == "b";
fs::path("a/b").lexically_relative("a/") == "b";

Actual behavior

fs::path("a/b").lexically_relative("a/") == "b";
fs::path("a/b").lexically_relative("a/") == "../b";

(tested on AppleClang 11.0.0 on macOS 10.15.3)