Commit c88fae33 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

search: match a beginning-of-line anchor just once per line

This fixes https://savannah.gnu.org/bugs/?48635.
No related merge requests found
Showing with 2 additions and 2 deletions
+2 -2
...@@ -745,8 +745,8 @@ ssize_t do_replace_loop( ...@@ -745,8 +745,8 @@ ssize_t do_replace_loop(
} }
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
/* Don't find the same zero-length match again. */ /* Don't find the same zero-length or BOL match again. */
if (match_len == 0) if (match_len == 0 || (*needle == '^' && ISSET(USE_REGEXP)))
match_len++; match_len++;
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment