slight bug in If command I think

This commit is contained in:
Ken Martin 2001-05-01 16:27:51 -04:00
parent 6847fe3705
commit de203f736c

View File

@ -45,30 +45,21 @@ bool cmIfFunctionBlocker::
IsFunctionBlocked(const char *name, const std::vector<std::string> &args, IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
const cmMakefile &mf) const const cmMakefile &mf) const
{ {
if (strcmp(name,"ELSE") && strcmp(name,"ENDIF")) if (!strcmp(name,"ELSE") || !strcmp(name,"ENDIF"))
{ {
return true; if (m_Not && (args.size() == 2) && !strcmp(args[0].c_str(),"NOT") &&
} !strcmp(args[1].c_str(),m_Define.c_str()))
if (m_Not && args.size() == 2)
{ {
if (strcmp(args[0].c_str(),"NOT"))
{
return true;
}
if (strcmp(args[1].c_str(),m_Define.c_str()))
{
return true;
}
}
else
{
if (strcmp(args[0].c_str(),m_Define.c_str()))
{
return true;
}
}
return false; return false;
} }
if (!m_Not && (args.size() == 1) &&
!strcmp(args[0].c_str(),m_Define.c_str()))
{
return false;
}
}
return true;
}
bool cmIfFunctionBlocker:: bool cmIfFunctionBlocker::
ShouldRemove(const char *name, const std::vector<std::string> &args, ShouldRemove(const char *name, const std::vector<std::string> &args,
@ -85,7 +76,7 @@ bool cmIfCommand::Invoke(std::vector<std::string>& args)
return false; return false;
} }
// check for the NOT vale // check for the NOT value
const char *def; const char *def;
if (args.size() == 2 && (args[0] == "NOT")) if (args.size() == 2 && (args[0] == "NOT"))
{ {