diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-08-22 13:25:14 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-08-22 13:25:14 (GMT) |
commit | a43976e91d8550fea5bdc06d63725869ca2ffb17 (patch) | |
tree | c95fc220acdf52d4b06e84602e9e51b6f62be1d5 /Source/kwsys/RegularExpression.hxx.in | |
parent | a47d3da96985398735f0a079ef37d7789a7f4e4d (diff) | |
download | CMake-a43976e91d8550fea5bdc06d63725869ca2ffb17.zip CMake-a43976e91d8550fea5bdc06d63725869ca2ffb17.tar.gz CMake-a43976e91d8550fea5bdc06d63725869ca2ffb17.tar.bz2 |
BUG: if there is no match, don't construct the stl string from a NULL
pointer
Alex
Diffstat (limited to 'Source/kwsys/RegularExpression.hxx.in')
-rw-r--r-- | Source/kwsys/RegularExpression.hxx.in | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/kwsys/RegularExpression.hxx.in b/Source/kwsys/RegularExpression.hxx.in index 5b6b451..5780c21 100644 --- a/Source/kwsys/RegularExpression.hxx.in +++ b/Source/kwsys/RegularExpression.hxx.in @@ -379,7 +379,14 @@ inline kwsys_stl::string::size_type RegularExpression::end(int n) const */ 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@ |