diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx index 5451004ab..ad11fe767 100644 --- a/Source/cmElseCommand.cxx +++ b/Source/cmElseCommand.cxx @@ -145,10 +145,14 @@ bool cmElseCommand::InitialPass(std::vector const& args) if (args.size() == 3 && (args[1] == "MATCHES")) { def = m_Makefile->GetDefinition(args[0].c_str()); + if (!def) + { + def = args[0].c_str(); + } cmRegularExpression regEntry(args[2].c_str()); // check for black line or comment - if (def && regEntry.find(def)) + if (regEntry.find(def)) { f = new cmIfFunctionBlocker(); } diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 85cb98d3a..2a3685374 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -140,10 +140,14 @@ bool cmIfCommand::InitialPass(std::vector const& args) if (args.size() == 3 && (args[1] == "MATCHES")) { def = m_Makefile->GetDefinition(args[0].c_str()); + if (!def) + { + def = args[0].c_str(); + } cmRegularExpression regEntry(args[2].c_str()); // check for black line or comment - if (!def || !regEntry.find(def)) + if (!regEntry.find(def)) { f = new cmIfFunctionBlocker(); }