]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix experimental::filesystem::status on Windows [PR88881]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 28 Jun 2022 14:56:30 +0000 (15:56 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 21 Jul 2022 08:57:25 +0000 (09:57 +0100)
commitf3ff78e3db0fc18127dac4fe3eaf113d0c5ddd01
tree9574b8762314c976f289503a984fbe7b8ebe3eb3
parentade3197134cc9ed2b7e589a7b58c73110ae13f1c
libstdc++: Fix experimental::filesystem::status on Windows [PR88881]

Although the Filesystem TS isn't properly supported on Windows (unlike
the C++17 Filesystem lib), most tests do pass. Two of the failures are
due to PR 88881 which was only fixed for std::filesystem not the TS.
This applies the fix to the TS implementation too.

libstdc++-v3/ChangeLog:

PR libstdc++/88881
* src/filesystem/ops.cc (has_trailing_slash): New helper
function.
(fs::status): Strip trailing slashes.
(fs::symlink_status): Likewise.
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Clean the environment before each test and use TMP instead of
TMPDIR so the test passes on Windows.

(cherry picked from commit 6c96b14a19a9e6c365eacc59868a866b99f9786d)
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc