diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-01-17 16:36:19 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-11 21:57:53 (GMT) |
commit | 7b8725bf8472ebf4781ddd60ef8fcca9c3ad98dd (patch) | |
tree | c7f440ea9c81f49b066c9dd196ce705d288558d4 /Source/cmListCommand.cxx | |
parent | 7ee56f03999e8605cc2cbe85a3a7b7159e639e5d (diff) | |
download | CMake-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.cxx | 12 |
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()); |