Commits

Anonymous committed 13be290

BUG: if there is no match, don't construct the stl string from a NULL
pointer

Alex

Comments (0)

Files changed (1)

GCC_XML/KWSys/RegularExpression.hxx.in

  */
 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@