better error checking for FOREACH

This commit is contained in:
Ken Martin 2004-05-12 14:32:25 -04:00
parent 0b2bdfa289
commit 79fcc81b6a
2 changed files with 4 additions and 14 deletions

View File

@ -18,18 +18,7 @@
bool cmEndForEachCommand::InvokeInitialPass(std::vector<cmListFileArgument> const& args) bool cmEndForEachCommand::InvokeInitialPass(std::vector<cmListFileArgument> const& args)
{ {
if(args.size() < 1 ) this->SetError("An ENDFOREACH command was found outside of a proper FOREACH ENDFOREACH structure. Or its arguments did not match the opening FOREACH command.");
{
this->SetError("called with incorrect number of arguments");
return false; return false;
}
// remove any function blockers for this define
cmListFileFunction lff;
lff.m_Name = "ENDFOREACH";
lff.m_Arguments = args;
m_Makefile->RemoveFunctionBlocker(lff);
return true;
} }

View File

@ -63,7 +63,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
mf.ExecuteCommand(newLFF); mf.ExecuteCommand(newLFF);
} }
} }
return false; mf.RemoveFunctionBlocker(lff);
return true;
} }
} }