From 90f6f25e31cafe9704707b1bb7d3b63e8789ef6f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 1 Jan 2021 20:09:42 +0100 Subject: [PATCH] oops: use the correct condition for checking the last line will change Only when the replacement string (in 'answer') is non-empty will the last line be changed and thus possibly a magic lined added. --- src/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text.c b/src/text.c index ffebb4c9..f5a586ee 100644 --- a/src/text.c +++ b/src/text.c @@ -1043,7 +1043,7 @@ void add_undo(undo_type action, const char *message) break; case REPLACE: u->strdata = copy_of(thisline->data); - if (thisline == openfile->filebot && u->strdata[0] != '\0') + if (thisline == openfile->filebot && answer[0] != '\0') u->xflags |= INCLUDED_LAST_LINE; break; #ifdef ENABLE_WRAPPING