[cfe-commits] [libcxx] r109750 - /libcxx/trunk/include/regex

Howard Hinnant hhinnant at apple.com
Thu Jul 29 08:17:28 PDT 2010


Author: hhinnant
Date: Thu Jul 29 10:17:28 2010
New Revision: 109750

URL: http://llvm.org/viewvc/llvm-project?rev=109750&view=rev
Log:
bug fix concerning search not at beginning of string and word boundaries

Modified:
    libcxx/trunk/include/regex

Modified: libcxx/trunk/include/regex
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/regex?rev=109750&r1=109749&r2=109750&view=diff
==============================================================================
--- libcxx/trunk/include/regex (original)
+++ libcxx/trunk/include/regex Thu Jul 29 10:17:28 2010
@@ -1907,7 +1907,8 @@
                               __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 @@
     }
     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;





More information about the cfe-commits mailing list