summaryrefslogtreecommitdiffstats
path: root/Source/cmListCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-17 16:36:19 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:57:53 (GMT)
commit7b8725bf8472ebf4781ddd60ef8fcca9c3ad98dd (patch)
treec7f440ea9c81f49b066c9dd196ce705d288558d4 /Source/cmListCommand.cxx
parent7ee56f03999e8605cc2cbe85a3a7b7159e639e5d (diff)
downloadCMake-7b8725bf8472ebf4781ddd60ef8fcca9c3ad98dd.zip
CMake-7b8725bf8472ebf4781ddd60ef8fcca9c3ad98dd.tar.gz
CMake-7b8725bf8472ebf4781ddd60ef8fcca9c3ad98dd.tar.bz2
Convert loops populating maybe-empty content into the common pattern.
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r--Source/cmListCommand.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 107dca9..8d1657d 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -254,14 +254,18 @@ bool cmListCommand::HandleAppendCommand(std::vector<std::string> const& args)
// expand the variable
std::string listString;
this->GetListString(listString, listName);
+
+ if(!listString.empty() && !args.empty())
+ {
+ listString += ";";
+ }
+ const char* sep = "";
size_t cc;
for ( cc = 2; cc < args.size(); ++ cc )
{
- if(!listString.empty())
- {
- listString += ";";
- }
+ listString += sep;
listString += args[cc];
+ sep = ";";
}
this->Makefile->AddDefinition(listName, listString.c_str());