diff options
author | William Sciaroni <William.Sciaroni@ngc.com> | 2023-08-14 19:48:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-08-15 13:53:41 (GMT) |
commit | 5a41d926dd2be80170bb3dfe28c710a169b0b8f1 (patch) | |
tree | 00eb4d2eeb32dbfc3974cd4f1915558f14ffc6a9 /Source | |
parent | f3d9a8211042c3df043d886f2217a705a62168a8 (diff) | |
download | CMake-5a41d926dd2be80170bb3dfe28c710a169b0b8f1.zip CMake-5a41d926dd2be80170bb3dfe28c710a169b0b8f1.tar.gz CMake-5a41d926dd2be80170bb3dfe28c710a169b0b8f1.tar.bz2 |
GHS: Escape custom command comments
Fixes: #25171
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGhsMultiTargetGenerator.cxx | 4 |
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)); } |