summaryrefslogtreecommitdiffstats
path: root/Source
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:36 (GMT)
commitb931fbd1b8b89b719650ed5c2131e9f3fd78f13a (patch)
tree58d621f4caf06c53b6f8804aa89d129a6ccef604 /Source
parentd667565d107affafa6556f676136fec1938d23bc (diff)
parent5a41d926dd2be80170bb3dfe28c710a169b0b8f1 (diff)
downloadCMake-b931fbd1b8b89b719650ed5c2131e9f3fd78f13a.zip
CMake-b931fbd1b8b89b719650ed5c2131e9f3fd78f13a.tar.gz
CMake-b931fbd1b8b89b719650ed5c2131e9f3fd78f13a.tar.bz2
Merge topic 'ghs-escape-custom-command-comments'
5a41d926dd GHS: Escape custom command comments Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8714
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 4475d88..95e2187 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -416,7 +416,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));
}