summaryrefslogtreecommitdiffstats
path: root/Source/cmForEachCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-07-17 14:48:39 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-07-17 14:48:39 (GMT)
commitfcc410de44e59fa4f6145292dc1f13a4498bd8b1 (patch)
tree3a26d56bed8920250e9a23e87444d7bf5e3d62d3 /Source/cmForEachCommand.cxx
parent3d3caacf9ec9f99cebcfaeb5ab105daa1046f945 (diff)
downloadCMake-fcc410de44e59fa4f6145292dc1f13a4498bd8b1.zip
CMake-fcc410de44e59fa4f6145292dc1f13a4498bd8b1.tar.gz
CMake-fcc410de44e59fa4f6145292dc1f13a4498bd8b1.tar.bz2
fixed if statements inside a foreach
Diffstat (limited to 'Source/cmForEachCommand.cxx')
-rw-r--r--Source/cmForEachCommand.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index e4cca41..c95c558 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -21,10 +21,16 @@ bool cmForEachFunctionBlocker::
IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
cmMakefile &mf)
{
+ // prevent recusion and don't let this blobker blobk its own commands
+ if (m_Executing)
+ {
+ return false;
+ }
// at end of for each execute recorded commands
if (!strcmp(name,"ENDFOREACH") && args[0] == m_Args[0])
{
+ m_Executing = true;
std::string variable = "${";
variable += m_Args[0];
variable += "}";
@@ -90,7 +96,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& argsIn)
std::vector<std::string> args;
cmSystemTools::ExpandListArguments(argsIn, args);
- if(args.size() < 2 )
+ if(args.size() < 1)
{
this->SetError("called with incorrect number of arguments");
return false;