mirror of
https://github.com/boostorg/regex.git
synced 2025-07-16 05:42:15 +02:00
Fixed bug in match_continuous code
[SVN r17276]
This commit is contained in:
@ -1229,6 +1229,7 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
|||||||
I next_base;
|
I next_base;
|
||||||
I base = first;
|
I base = first;
|
||||||
bool need_init;
|
bool need_init;
|
||||||
|
bool leading_match = false;
|
||||||
const traits& traits_inst = e.get_traits();
|
const traits& traits_inst = e.get_traits();
|
||||||
// dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
|
// dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
|
||||||
// referenced
|
// referenced
|
||||||
@ -1262,6 +1263,7 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
|||||||
if(query_match_aux(first, last, m, e, flags, pd, &restart))
|
if(query_match_aux(first, last, m, e, flags, pd, &restart))
|
||||||
{
|
{
|
||||||
++cmatches;
|
++cmatches;
|
||||||
|
leading_match = true;
|
||||||
if(foo(m) == false)
|
if(foo(m) == false)
|
||||||
return cmatches;
|
return cmatches;
|
||||||
if(m[0].second == last)
|
if(m[0].second == last)
|
||||||
@ -1284,6 +1286,7 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
need_init = false;
|
need_init = false;
|
||||||
|
leading_match = false;
|
||||||
for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
|
for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
|
||||||
{} // dwa 10/20/2000 - warning suppression for MWCW
|
{} // dwa 10/20/2000 - warning suppression for MWCW
|
||||||
if(restart != last)
|
if(restart != last)
|
||||||
@ -1627,6 +1630,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
|||||||
break;
|
break;
|
||||||
case regbase::restart_continue:
|
case regbase::restart_continue:
|
||||||
{
|
{
|
||||||
|
if(!leading_match)
|
||||||
|
return cmatches;
|
||||||
while(first != last)
|
while(first != last)
|
||||||
{
|
{
|
||||||
if( access::can_start(*first, _map, (unsigned char)mask_any) )
|
if( access::can_start(*first, _map, (unsigned char)mask_any) )
|
||||||
|
Reference in New Issue
Block a user