summaryrefslogtreecommitdiff
path: root/Source/cmOutputConverter.cxx
diff options
context:
space:
mode:
authorEd Hartley <ehartley@mathworks.com>2022-10-18 09:20:44 +0100
committerBrad King <brad.king@kitware.com>2022-10-18 14:30:57 -0400
commit9777e4c30e55fb84c13727b322665f116fa49473 (patch)
tree589df0b74cd7f717f0b2cc16fa13806bd887e321 /Source/cmOutputConverter.cxx
parent53841c6ea2007f74d8e04e09a458a55607c93cf1 (diff)
downloadcmake-9777e4c30e55fb84c13727b322665f116fa49473.tar.gz
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
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r--Source/cmOutputConverter.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 688353577d..299ab3a437 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;
}