1. Jason R. Coombs
  2. gcc-xml

Commits

alex  committed 13be290

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

Alex

  • Participants
  • Parent commits bd1c65b
  • Branches default
  • Tags OverView-0-9-bp

Comments (0)

Files changed (1)

File GCC_XML/KWSys/RegularExpression.hxx.in

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