summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorPeter Würth <wuerth.peter@freenet.de>2022-11-17 11:12:26 (GMT)
committerPeter Würth <wuerth.peter@freenet.de>2022-11-19 12:32:56 (GMT)
commit60a5a39022c8c2504173d635732110b2550b7f91 (patch)
treefa0ef8f4a0512f483200d526a0b2c205e5857b37 /Source/cmLocalVisualStudio7Generator.cxx
parentd8c8e61633328b4e2247ce381e22ddc71dd0fbbf (diff)
downloadCMake-60a5a39022c8c2504173d635732110b2550b7f91.zip
CMake-60a5a39022c8c2504173d635732110b2550b7f91.tar.gz
CMake-60a5a39022c8c2504173d635732110b2550b7f91.tar.bz2
cmCustomCommandGenerator: refactor GetComment to return std::string
Refactoring was done because EvaluateComment leaked memory.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 383045d..538c036 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -10,6 +10,7 @@
#include <utility>
#include <cm/memory>
+#include <cm/optional>
#include <cmext/algorithm>
#include <windows.h>
@@ -592,9 +593,8 @@ public:
{
cmCustomCommandGenerator ccg(cc, this->Config, this->LG);
if (this->First) {
- const char* comment = ccg.GetComment();
- if (comment && *comment) {
- this->Stream << "\nDescription=\"" << this->LG->EscapeForXML(comment)
+ if (cm::optional<std::string> comment = ccg.GetComment()) {
+ this->Stream << "\nDescription=\"" << this->LG->EscapeForXML(*comment)
<< "\"";
}
this->Stream << "\nCommandLine=\"";