[cmake-commits] alex committed RegularExpression.hxx.in 1.8 1.9
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Aug 22 09:25:17 EDT 2007
Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv30533
Modified Files:
RegularExpression.hxx.in
Log Message:
BUG: if there is no match, don't construct the stl string from a NULL
pointer
Alex
Index: RegularExpression.hxx.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/RegularExpression.hxx.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- RegularExpression.hxx.in 3 May 2005 18:27:39 -0000 1.8
+++ RegularExpression.hxx.in 22 Aug 2007 13:25:14 -0000 1.9
@@ -379,7 +379,14 @@
*/
inline kwsys_stl::string RegularExpression::match(int n) const
{
- return kwsys_stl::string(this->startp[n], this->endp[n] - this->startp[n]);
+ if (this->startp[n]==0)
+ {
+ return kwsys_stl::string("");
+ }
+ else
+ {
+ return kwsys_stl::string(this->startp[n], this->endp[n] - this->startp[n]);
+ }
}
} // namespace @KWSYS_NAMESPACE@
More information about the Cmake-commits
mailing list