regex: Fixed spurious matches when grepping with .*

[SVN r9686]
This commit is contained in:
John Maddock
2001-03-31 11:24:27 +00:00
parent fac0fa6653
commit 020cbe902e
3 changed files with 22 additions and 0 deletions

View File

@ -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...