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.
master
Benno Schulenberg 2021-01-01 20:09:42 +01:00
parent 0f4bb64eaf
commit 90f6f25e31
1 changed files with 1 additions and 1 deletions

View File

@ -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