summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-22 18:06:48 (GMT)
committerBrad King <brad.king@kitware.com>2021-04-26 18:27:34 (GMT)
commitb3ca4f9ad18220b2f56cd6af7df5cf1e671d39a8 (patch)
tree357cc4753e168658e38303fcba0b8305ed999dd2 /Utilities
parentc9aec3d4a97e8390756ea7004b9d2b065714b875 (diff)
downloadCMake-b3ca4f9ad18220b2f56cd6af7df5cf1e671d39a8.zip
CMake-b3ca4f9ad18220b2f56cd6af7df5cf1e671d39a8.tar.gz
CMake-b3ca4f9ad18220b2f56cd6af7df5cf1e671d39a8.tar.bz2
cm/filesystem: Work around crash when compiled for CYGWIN/MSYS runtime
Issue: #22090
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/std/cm/filesystem8
1 files changed, 8 insertions, 0 deletions
diff --git a/Utilities/std/cm/filesystem b/Utilities/std/cm/filesystem
index 6cbdea9..ce52fbf 100644
--- a/Utilities/std/cm/filesystem
+++ b/Utilities/std/cm/filesystem
@@ -809,6 +809,10 @@ public:
path& remove_filename()
{
+# if defined(__CYGWIN__)
+ // FIXME: Avoid crash due to CYGWIN/MSYS bug(?). See CMake Issue 22090.
+ static_cast<void>(this->path_.data());
+# endif
auto fname = this->get_filename();
if (!fname.empty()) {
this->path_.erase(fname.data() - this->path_.data());
@@ -825,6 +829,10 @@ public:
path& replace_extension(const path& replacement = path())
{
+# if defined(__CYGWIN__)
+ // FIXME: Avoid crash due to CYGWIN/MSYS bug(?). See CMake Issue 22090.
+ static_cast<void>(this->path_.data());
+# endif
auto ext = this->get_filename_fragment(filename_fragment::extension);
if (!ext.empty()) {
this->path_.erase(ext.data() - this->path_.data());