summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-05-01 20:27:51 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-05-01 20:27:51 (GMT)
commitde203f736cab8d8f9666e56520ca1e53447d8837 (patch)
treee3650e2e14bc05cc805fb5253cea7a785035558d /Source/cmIfCommand.cxx
parent6847fe3705f067060bb5c757cc4e016e37b50329 (diff)
downloadCMake-de203f736cab8d8f9666e56520ca1e53447d8837.zip
CMake-de203f736cab8d8f9666e56520ca1e53447d8837.tar.gz
CMake-de203f736cab8d8f9666e56520ca1e53447d8837.tar.bz2
slight bug in If command I think
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx27
1 files changed, 9 insertions, 18 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 37daba6..1425cbb 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -45,29 +45,20 @@ bool cmIfFunctionBlocker::
IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
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)
- {
- if (strcmp(args[0].c_str(),"NOT"))
- {
- return true;
- }
- if (strcmp(args[1].c_str(),m_Define.c_str()))
+ if (m_Not && (args.size() == 2) && !strcmp(args[0].c_str(),"NOT") &&
+ !strcmp(args[1].c_str(),m_Define.c_str()))
{
- return true;
+ return false;
}
- }
- else
- {
- if (strcmp(args[0].c_str(),m_Define.c_str()))
+ if (!m_Not && (args.size() == 1) &&
+ !strcmp(args[0].c_str(),m_Define.c_str()))
{
- return true;
+ return false;
}
}
- return false;
+ return true;
}
bool cmIfFunctionBlocker::
@@ -85,7 +76,7 @@ bool cmIfCommand::Invoke(std::vector<std::string>& args)
return false;
}
- // check for the NOT vale
+ // check for the NOT value
const char *def;
if (args.size() == 2 && (args[0] == "NOT"))
{