summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-07-29 15:17:28 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-07-29 15:17:28 +0000
commit7189782c6bc2f643744b94d2941de7e26b448aea (patch)
treeaf67a72da43ffef92b3cfbdd3b3d15dc74bf1212
parentf65f490ae9874aaaaf2ab6b7d8daf3aec821d0a4 (diff)
downloadbcm5719-llvm-7189782c6bc2f643744b94d2941de7e26b448aea.tar.gz
bcm5719-llvm-7189782c6bc2f643744b94d2941de7e26b448aea.zip
bug fix concerning search not at beginning of string and word boundaries
llvm-svn: 109750
-rw-r--r--libcxx/include/regex6
1 files changed, 4 insertions, 2 deletions
diff --git a/libcxx/include/regex b/libcxx/include/regex
index efcc7df7f6b..51ba1eaf165 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -1907,7 +1907,8 @@ __word_boundary<_CharT, _Traits>::__exec(__state& __s) const
__traits_.isctype(__c, ctype_base::alnum);
}
}
- else if (__s.__current_ == __s.__first_)
+ else if (__s.__current_ == __s.__first_ &&
+ !(__s.__flags_ & regex_constants::match_prev_avail))
{
if (!(__s.__flags_ & regex_constants::match_not_bow))
{
@@ -5406,9 +5407,10 @@ basic_regex<_CharT, _Traits>::__search(
}
if (__first != __last && !(__flags & regex_constants::match_continuous))
{
- __m.__matches_.assign(__m.size(), __m.__unmatched_);
+ __flags |= regex_constants::match_prev_avail;
for (++__first; __first != __last; ++__first)
{
+ __m.__matches_.assign(__m.size(), __m.__unmatched_);
if (__match_at_start(__first, __last, __m, __flags))
{
__m.__prefix_.second = __m[0].first;
OpenPOWER on IntegriCloud