summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Hartley <ehartley@mathworks.com>2022-10-18 08:20:44 (GMT)
committerBrad King <brad.king@kitware.com>2022-10-18 18:30:57 (GMT)
commit9777e4c30e55fb84c13727b322665f116fa49473 (patch)
tree589df0b74cd7f717f0b2cc16fa13806bd887e321
parent53841c6ea2007f74d8e04e09a458a55607c93cf1 (diff)
downloadCMake-9777e4c30e55fb84c13727b322665f116fa49473.zip
CMake-9777e4c30e55fb84c13727b322665f116fa49473.tar.gz
CMake-9777e4c30e55fb84c13727b322665f116fa49473.tar.bz2
MinGW Makefiles: Quote UNC paths on command lines
UNC paths (starting with `\\`) need quotes when generating MinGW Makefiles to avoid gmake interpreting the first `\` as an escape character. Fixes: #24061
-rw-r--r--Source/cmOutputConverter.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 6883535..299ab3a 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -527,6 +527,13 @@ bool cmOutputConverter::Shell_ArgumentNeedsQuotes(cm::string_view in,
}
}
+ /* UNC paths in MinGW Makefiles need quotes. */
+ if ((flags & Shell_Flag_MinGWMake) && (flags & Shell_Flag_Make)) {
+ if (in.size() > 1 && in[0] == '\\' && in[1] == '\\') {
+ return true;
+ }
+ }
+
return false;
}