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

Wrong result from stem/filename/extension when the ':' character is present in the filename #156

Closed petersjogren closed 1 year ago

petersjogren commented 1 year ago

I suspect that this is a bug. std::filesystem behaves as expected but ghc::filesystem does not behave as expected (see below).

On Mac with ghc::filesystem: A path with the filename "t:est.txt"

extension() returns "". Expected: ".txt" filename() returns "t:". Expected: "t:est.txt" stem() returns "t:". Expected: "t:est"

These tests all fail: CHECK(fs::path("t:est.txt").extension() == ".txt"); CHECK(fs::path("t:est.txt").filename() == "t:est.txt"); CHECK(fs::path("t:est.txt").stem() == "t:est");

gulrak commented 1 year ago

Oh, that is unexpected, indeed. I'll look into it.

gulrak commented 1 year ago

Released with v1.5.14.