summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-08-16 13:46:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-08-16 13:46:35 (GMT)
commit9cde869b113178930482becf61bebe25ce3bef98 (patch)
tree054b609dd3b59e8f8be3efff19393be018ee1ee5
parentfcb944a11ba00c5be42596eb45ac24214d357432 (diff)
parent5a41d926dd2be80170bb3dfe28c710a169b0b8f1 (diff)
downloadCMake-9cde869b113178930482becf61bebe25ce3bef98.zip
CMake-9cde869b113178930482becf61bebe25ce3bef98.tar.gz
CMake-9cde869b113178930482becf61bebe25ce3bef98.tar.bz2
Merge topic 'ghs-escape-custom-command-comments' into release-3.27
5a41d926dd GHS: Escape custom command comments Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8714
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index a1e0650..2d35b8f 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -415,7 +415,9 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
#endif
// Echo the custom command's comment text.
if (cm::optional<std::string> comment = ccg.GetComment()) {
- std::string echocmd = cmStrCat("echo ", *comment);
+ std::string escapedComment = this->LocalGenerator->EscapeForShell(
+ *comment, ccg.GetCC().GetEscapeAllowMakeVars());
+ std::string echocmd = cmStrCat("echo ", escapedComment);
cmdLines.push_back(std::move(echocmd));
}