[cmake-commits] alex committed cmStringCommand.cxx 1.25 1.26

cmake-commits at cmake.org cmake-commits at cmake.org
Sun Dec 16 07:56:45 EST 2007


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

Modified Files:
	cmStringCommand.cxx 
Log Message:
BUG: fix STRING(STRIP ...) if no non-space is contained in the input string,
this should fix the dashboard

Alex


Index: cmStringCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmStringCommand.cxx,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cmStringCommand.cxx	29 Aug 2007 15:58:38 -0000	1.25
+++ cmStringCommand.cxx	16 Dec 2007 12:56:43 -0000	1.26
@@ -675,8 +675,20 @@
     ++ ptr;
     }
 
-  size_t outLength = endPos - startPos + 1;
- 
+  size_t outLength = 0;
+
+  // if the input string didn't contain any non-space characters, return 
+  // an empty string
+  if (startPos > inStringLength)
+    {
+    outLength = 0;
+    startPos = 0;
+    }
+  else
+    {
+    outLength=endPos - startPos + 1;
+    }
+
   this->Makefile->AddDefinition(variableName.c_str(),
     stringValue.substr(startPos, outLength).c_str());
   return true;



More information about the Cmake-commits mailing list