summaryrefslogtreecommitdiffstats
path: root/Source/cmListCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-08-22 13:52:53 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-08-22 13:52:53 (GMT)
commit6f7bb4d826863ba9f0996a12854ed2ff61915b13 (patch)
tree7a6fe5b26a725542a7bdbb00fc1e475dd09c5d98 /Source/cmListCommand.cxx
parent377e4c132f4febeddc1b899fb032276ef0303bcb (diff)
downloadCMake-6f7bb4d826863ba9f0996a12854ed2ff61915b13.zip
CMake-6f7bb4d826863ba9f0996a12854ed2ff61915b13.tar.gz
CMake-6f7bb4d826863ba9f0996a12854ed2ff61915b13.tar.bz2
BUG: Fix error messages and fix remove item to actually remove all instances of the item
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r--Source/cmListCommand.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 49bb354..bc43ecb 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -258,7 +258,7 @@ bool cmListCommand
{
if(args.size() < 3)
{
- this->SetError("sub-command REMOVE requires at least two arguments.");
+ this->SetError("sub-command REMOVE_ITEM requires at least two arguments.");
return false;
}
@@ -267,6 +267,7 @@ bool cmListCommand
std::vector<std::string> varArgsExpanded;
if ( !this->GetList(varArgsExpanded, listName.c_str()) )
{
+ this->SetError("sub-command REMOVE_ITEM requires list to be present.");
return false;
}
@@ -280,7 +281,10 @@ bool cmListCommand
{
varArgsExpanded.erase(varArgsExpanded.begin()+kk);
}
- kk ++;
+ else
+ {
+ kk ++;
+ }
}
}
@@ -304,7 +308,7 @@ bool cmListCommand::HandleRemoveAtCommand(
{
if(args.size() < 3)
{
- this->SetError("sub-command REMOVE_ITEM requires at least "
+ this->SetError("sub-command REMOVE_AT requires at least "
"two arguments.");
return false;
}
@@ -314,6 +318,7 @@ bool cmListCommand::HandleRemoveAtCommand(
std::vector<std::string> varArgsExpanded;
if ( !this->GetList(varArgsExpanded, listName.c_str()) )
{
+ this->SetError("sub-command REMOVE_AT requires list to be present.");
return false;
}