From 4d6ec376769d4e53c4c0c4eb322894ec75ef06b4 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 23 Nov 2004 17:59:32 +0000 Subject: [PATCH] in do_cut_text(), if keep_cutbuffer is FALSE, only blow away the text in the cutbuffer if the cutbuffer isn't empty git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2126 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/cut.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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 -- 2.39.5