Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-04-09 11:05:50


> Actually, now that I look at the code, should it simply be
>
> < if(((m_match_flags & match_not_null) == 0) && (m_presult->length()
== 0))
> ---
> > if(((m_match_flags & match_not_null) == 0) && (m_result.length() ==
0))
>
> just below the original patch? That _seems_ to work.

Almost, here's the complete patch going into cvs now:

$ cvs diff -u
johnmaddock_at_[hidden]'s password:
cvs diff: Diffing .
Index: perl_matcher_common.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/regex/v4/perl_matcher_common.hpp,v
retrieving revision 1.18.2.1
diff -u -r1.18.2.1 perl_matcher_common.hpp
--- perl_matcher_common.hpp 7 Apr 2004 11:03:31 -0000 1.18.2.1
+++ perl_matcher_common.hpp 9 Apr 2004 15:50:27 -0000
@@ -208,7 +208,7 @@
       search_base = position = m_result[0].second;
       // If last match was null and match_not_null was not set then
increment
       // our start position, otherwise we go into an infinite loop:
- if(((m_match_flags & match_not_null) == 0) && (m_presult->length() ==
0))
+ if(((m_match_flags & match_not_null) == 0) && (m_result.length() ==
0))
       {
          if(position == last)
             return false;
Index: regex_grep.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/regex/v4/regex_grep.hpp,v
retrieving revision 1.6
diff -u -r1.6 regex_grep.hpp
--- regex_grep.hpp 4 Oct 2003 11:28:56 -0000 1.6
+++ regex_grep.hpp 9 Apr 2004 15:50:27 -0000
@@ -55,23 +55,23 @@
          return count; // we've reached the end, don't try and find an
extra null match.
       if(m.length() == 0)
       {
+ if(m[0].second == last)
+ return count;
          // we found a NULL-match, now try to find
          // a non-NULL one at the same position:
- BidiIterator last_end(m[0].second);
- if(last_end == last)
- return count;
+ match_results<BidiIterator, match_allocator_type> m2(m);
          matcher.setf(match_not_null | match_continuous);
          if(matcher.find())
          {
             ++count;
- last_end = m[0].second;
+ //last_end = m[0].second;
             if(0 == foo(m))
                return count;
          }
          else
          {
             // reset match back to where it was:
- m.set_second(last_end);
+ m = m2;
          }
          matcher.unsetf((match_not_null | match_continuous) & ~flags);
       }


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk