diff --git a/ChangeLog b/ChangeLog index 55296e37..4831f394 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,9 @@ CVS code - buffer rather than the cutbuffer. Changes to backup_lines(), do_justify(), etc. (DLR) - cut.c: + do_cut_text() + - If keep_cutbuffer is FALSE, only blow away the text in the + cutbuffer if the cutbuffer isn't empty. (DLR) do_uncut_text() - No longer duplicate Pico's adding an extra magicline to the file if uncutting leaves the cursor on the current one, as diff --git a/src/cut.c b/src/cut.c index a90defa6..1d4cac6c 100644 --- a/src/cut.c +++ b/src/cut.c @@ -101,9 +101,9 @@ void do_cut_text(void) check_statusblank(); - /* If keep_cutbuffer is FALSE, blow away the text in the - * cutbuffer. */ - if (!keep_cutbuffer) { + /* If keep_cutbuffer is FALSE and the cutbuffer isn't empty, blow + * away the text in the cutbuffer. */ + if (!keep_cutbuffer && cutbuffer != NULL) { free_filestruct(cutbuffer); cutbuffer = NULL; #ifdef DEBUG