summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/Checks/cm_cxx_filesystem.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Checks/cm_cxx_filesystem.cxx b/Source/Checks/cm_cxx_filesystem.cxx
index c8df589..bdc7c6d 100644
--- a/Source/Checks/cm_cxx_filesystem.cxx
+++ b/Source/Checks/cm_cxx_filesystem.cxx
@@ -9,12 +9,13 @@ int main()
std::filesystem::path p0(L"/a/b/c");
std::filesystem::path p1("/a/b/c");
- std::filesystem::path p2("/a/b/c");
- if (p1 != p2) {
+ std::filesystem::path p2("/a/b//c");
+ if (p1 != p2.lexically_normal()) {
return 1;
}
#if defined(_WIN32)
+ // "//host/" is not preserved in some environments like GNU under MinGW.
std::filesystem::path p3("//host/a/b/../c");
if (p3.lexically_normal().generic_string() != "//host/a/c") {
return 1;
@@ -24,6 +25,12 @@ int main()
if (p4.lexically_normal().generic_string() != "c:/a/") {
return 1;
}
+
+ std::filesystem::path b1("C:\\path\\y\\..\\");
+ if (std::filesystem::weakly_canonical("\\\\?\\C:\\path\\x\\..") !=
+ b1.lexically_normal()) {
+ return 1;
+ }
#endif
// If std::string is copy-on-write, the std::filesystem::path