commit 4d6ec376769d4e53c4c0c4eb322894ec75ef06b4
parent bc3b92605e8c22a27bfb6f7dae78bb7b1ee6f9b6
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 23 Nov 2004 17:59:32 +0000
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
Diffstat:
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git 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
@@ -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