diff options
author | Brad King <brad.king@kitware.com> | 2006-10-25 14:57:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-10-25 14:57:26 (GMT) |
commit | b7e04e69ae872f3e665199c15b6a27ad6d91035f (patch) | |
tree | e0f7a825f8b9b7a615bd78fbf93b1c0ec2b9d36c /Source | |
parent | d563ab6677ae5a1e871a528208351eba46942eca (diff) | |
download | CMake-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.cxx | 21 |
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) { |