summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-25 14:57:26 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-25 14:57:26 (GMT)
commitb7e04e69ae872f3e665199c15b6a27ad6d91035f (patch)
treee0f7a825f8b9b7a615bd78fbf93b1c0ec2b9d36c /Source
parentd563ab6677ae5a1e871a528208351eba46942eca (diff)
downloadCMake-b7e04e69ae872f3e665199c15b6a27ad6d91035f.zip
CMake-b7e04e69ae872f3e665199c15b6a27ad6d91035f.tar.gz
CMake-b7e04e69ae872f3e665199c15b6a27ad6d91035f.tar.bz2
BUG: It cannot be an error if the values do not convert. The docs say that if the values do not convert the test is false.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmIfCommand.cxx21
1 files changed, 4 insertions, 17 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 9dcaf9b..2c69d83 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -395,26 +395,13 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
def2 = cmIfCommand::GetVariableOrString((argP2)->c_str(), makefile);
double lhs;
- if(sscanf(def, "%lg", &lhs) != 1)
- {
- cmOStringStream error;
- error << "could not convert \"" << def << "\" to a number";
- delete [] *errorString;
- *errorString = new char[error.str().size() + 1];
- strcpy(*errorString, error.str().c_str());
- return false;
- }
double rhs;
- if(sscanf(def2, "%lg", &rhs) != 1)
+ if(sscanf(def, "%lg", &lhs) != 1 ||
+ sscanf(def2, "%lg", &rhs) != 1)
{
- cmOStringStream error;
- error << "could not convert \"" << def2 << "\" to a number";
- delete [] *errorString;
- *errorString = new char[error.str().size() + 1];
- strcpy(*errorString, error.str().c_str());
- return false;
+ *arg = "0";
}
- if (*(argP1) == "LESS")
+ else if (*(argP1) == "LESS")
{
if(lhs < rhs)
{