search: match a beginning-of-line anchor just once per line
This fixes https://savannah.gnu.org/bugs/?48635.master
parent
68cfb08888
commit
c88fae3310
|
@ -745,8 +745,8 @@ ssize_t do_replace_loop(
|
|||
}
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
/* Don't find the same zero-length match again. */
|
||||
if (match_len == 0)
|
||||
/* Don't find the same zero-length or BOL match again. */
|
||||
if (match_len == 0 || (*needle == '^' && ISSET(USE_REGEXP)))
|
||||
match_len++;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue