summaryrefslogtreecommitdiffstats
path: root/Source/cmRemoveCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-08-05 13:51:50 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-08-05 13:51:50 (GMT)
commitab2dc5558b339a4969b9ff679d4f75a5f11618a0 (patch)
tree69ecb3979b6618d1b3214974f0d2e328ab399f50 /Source/cmRemoveCommand.cxx
parent596614e9aaf5c5a33a6f6611240ac6ad2f240854 (diff)
downloadCMake-ab2dc5558b339a4969b9ff679d4f75a5f11618a0.zip
CMake-ab2dc5558b339a4969b9ff679d4f75a5f11618a0.tar.gz
CMake-ab2dc5558b339a4969b9ff679d4f75a5f11618a0.tar.bz2
minor fix
Diffstat (limited to 'Source/cmRemoveCommand.cxx')
-rw-r--r--Source/cmRemoveCommand.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx
index 982432b..9973b60 100644
--- a/Source/cmRemoveCommand.cxx
+++ b/Source/cmRemoveCommand.cxx
@@ -19,10 +19,9 @@
// cmRemoveCommand
bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args)
{
- if(args.size() < 2 )
+ if(args.size() < 1)
{
- this->SetError("called with incorrect number of arguments");
- return false;
+ return true;
}
const char* variable = args[0].c_str(); // VAR is always first
@@ -30,6 +29,12 @@ bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args)
const char* cacheValue
= m_Makefile->GetDefinition(variable);
+ // if there is no old value then return
+ if (!cacheValue)
+ {
+ return true;
+ }
+
// expand the variable
std::vector<std::string> varArgsExpanded;
std::vector<std::string> temp;