commit 90f6f25e31cafe9704707b1bb7d3b63e8789ef6f
parent 0f4bb64eaf98b54c601c86a19b2a5c3209c439cf
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 1 Jan 2021 20:09:42 +0100
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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