mirror of
https://github.com/boostorg/regex.git
synced 2025-07-12 11:56:37 +02:00
regex: Fixed spurious matches when grepping with .*
[SVN r9686]
This commit is contained in:
@ -1113,6 +1113,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
++cmatches;
|
||||
if(foo(m) == false)
|
||||
return cmatches;
|
||||
if(m[0].second == last)
|
||||
return cmatches;
|
||||
// update to end of what matched
|
||||
// trying to match again with match_not_null set if this
|
||||
// is a null match...
|
||||
@ -1201,6 +1203,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
pd.temp_match.init_fail(next_base, last);
|
||||
m.init_fail(next_base, last);
|
||||
j = 0;
|
||||
if(m[0].second == last)
|
||||
return cmatches;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1213,6 +1217,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
++cmatches;
|
||||
if(foo(m) == false)
|
||||
return cmatches;
|
||||
if(m[0].second == last)
|
||||
return cmatches;
|
||||
// update to end of what matched
|
||||
_skip_and_inc(clines, last_line, first, m[0].second);
|
||||
next_base = m[0].second;
|
||||
@ -1247,6 +1253,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
++cmatches;
|
||||
if(foo(m) == false)
|
||||
return cmatches;
|
||||
if(m[0].second == last)
|
||||
return cmatches;
|
||||
// update to end of what matched
|
||||
// trying to match again with match_not_null set if this
|
||||
// is a null match...
|
||||
@ -1336,6 +1344,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
++cmatches;
|
||||
if(foo(m) == false)
|
||||
return cmatches;
|
||||
if(m[0].second == last)
|
||||
return cmatches;
|
||||
// update to end of what matched
|
||||
// trying to match again with match_not_null set if this
|
||||
// is a null match...
|
||||
@ -1412,6 +1422,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
++cmatches;
|
||||
if(foo(m) == false)
|
||||
return cmatches;
|
||||
if(m[0].second == last)
|
||||
return cmatches;
|
||||
// update to end of what matched
|
||||
// trying to match again with match_not_null set if this
|
||||
// is a null match...
|
||||
@ -1472,6 +1484,8 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
|
||||
++cmatches;
|
||||
if(foo(m) == false)
|
||||
return cmatches;
|
||||
if(m[0].second == last)
|
||||
return cmatches;
|
||||
// update to end of what matched
|
||||
// trying to match again with match_not_null set if this
|
||||
// is a null match...
|
||||
|
Reference in New Issue
Block a user