summaryrefslogtreecommitdiffstats
path: root/Source/cmListCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-16 16:24:41 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-16 16:24:41 (GMT)
commita06dcdba970b5ea1cf570de1a9f7f038af849496 (patch)
treec419479a81cef8ab4e99115bc526dfe05a20887b /Source/cmListCommand.cxx
parenta5ac3161551969fce1956f6ebbefc0bbfccbd18e (diff)
downloadCMake-a06dcdba970b5ea1cf570de1a9f7f038af849496.zip
CMake-a06dcdba970b5ea1cf570de1a9f7f038af849496.tar.gz
CMake-a06dcdba970b5ea1cf570de1a9f7f038af849496.tar.bz2
ENH: Allow LIST(APPEND) command to append nothing.
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r--Source/cmListCommand.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index c00f6eb..b7519ab 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -179,12 +179,18 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
//----------------------------------------------------------------------------
bool cmListCommand::HandleAppendCommand(std::vector<std::string> const& args)
{
- if(args.size() < 3)
+ if(args.size() < 2)
{
- this->SetError("sub-command APPEND requires at least two arguments.");
+ this->SetError("sub-command APPEND requires at least one argument.");
return false;
}
+ // Skip if nothing to append.
+ if(args.size() < 3)
+ {
+ return true;
+ }
+
const std::string& listName = args[1];
// expand the variable
std::string listString;