1
1

replacing: detect when the whole region has already been covered

Even when a match falls within the marked region, this does not mean
that it is a true match when already the whole file has been searched,
because then this is the second time we find this match.

This fixes https://savannah.gnu.org/bugs/?50158.
Этот коммит содержится в:
Benno Schulenberg 2017-01-26 21:25:15 +01:00
родитель 94e563232e
Коммит 437cb410e9

Просмотреть файл

@ -623,7 +623,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
if (old_mark_set) {
/* When we've found an occurrence outside of the marked region,
* stop the fanfare. */
if (openfile->current->lineno > bot->lineno ||
if (came_full_circle || openfile->current->lineno > bot->lineno ||
openfile->current->lineno < top->lineno ||
(openfile->current == bot && openfile->current_x + match_len > bot_x) ||
(openfile->current == top && openfile->current_x < top_x))