diff --git a/ChangeLog b/ChangeLog index 5350e48c..3ddb19a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ * src/search.c (do_gotolinecolumn): Delete another unneeded variable. * src/search.c (search_init): Snip an always-FALSE condition. * src/search.c (search_init): Reshuffle stuff to reduce indentation. + * src/search.c (do_replace): Snip a useless setting of answer. 2016-03-17 Benno Schulenberg * src/search.c (do_research): Use the Search key bindings also during diff --git a/src/search.c b/src/search.c index a26fad55..635266da 100644 --- a/src/search.c +++ b/src/search.c @@ -861,12 +861,10 @@ void do_replace(void) update_history(&replace_history, answer); #endif - if (i != 0 && i != -2) { - if (i == -1) { /* Cancel. */ - if (last_replace[0] != '\0') - answer = mallocstrcpy(answer, last_replace); + /* When cancelled, or when a function was run, get out. */ + if (i == -1 || i > 0) { + if (i == -1) statusbar(_("Cancelled")); - } search_replace_abort(); return; }