summaryrefslogtreecommitdiffstats
path: root/Source/cmStringCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r--Source/cmStringCommand.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index a7c21cc..653b383 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -20,6 +20,7 @@
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmProperty.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmStringReplaceHelper.h"
@@ -535,11 +536,7 @@ bool HandleAppendCommand(std::vector<std::string> const& args,
const std::string& variable = args[1];
- std::string value;
- const char* oldValue = status.GetMakefile().GetDefinition(variable);
- if (oldValue) {
- value = oldValue;
- }
+ std::string value = status.GetMakefile().GetSafeDefinition(variable);
value += cmJoin(cmMakeRange(args).advance(2), std::string());
status.GetMakefile().AddDefinition(variable, value);
return true;
@@ -561,9 +558,9 @@ bool HandlePrependCommand(std::vector<std::string> const& args,
const std::string& variable = args[1];
std::string value = cmJoin(cmMakeRange(args).advance(2), std::string());
- const char* oldValue = status.GetMakefile().GetDefinition(variable);
+ cmProp oldValue = status.GetMakefile().GetDefinition(variable);
if (oldValue) {
- value += oldValue;
+ value += *oldValue;
}
status.GetMakefile().AddDefinition(variable, value);
return true;