minor fix

This commit is contained in:
Ken Martin 2002-08-05 09:51:50 -04:00
parent 596614e9aa
commit ab2dc5558b
1 changed files with 8 additions and 3 deletions

View File

@ -19,10 +19,9 @@
// cmRemoveCommand // cmRemoveCommand
bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args) 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 true;
return false;
} }
const char* variable = args[0].c_str(); // VAR is always first 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 const char* cacheValue
= m_Makefile->GetDefinition(variable); = m_Makefile->GetDefinition(variable);
// if there is no old value then return
if (!cacheValue)
{
return true;
}
// expand the variable // expand the variable
std::vector<std::string> varArgsExpanded; std::vector<std::string> varArgsExpanded;
std::vector<std::string> temp; std::vector<std::string> temp;