[cmake-commits] king committed cmIfCommand.cxx 1.72 1.73

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Oct 25 10:57:29 EDT 2006


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv3762

Modified Files:
	cmIfCommand.cxx 
Log Message:
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.


Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- cmIfCommand.cxx	25 Oct 2006 14:31:26 -0000	1.72
+++ cmIfCommand.cxx	25 Oct 2006 14:57:26 -0000	1.73
@@ -395,26 +395,13 @@
         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)
             {



More information about the Cmake-commits mailing list