From 0c561f03253fdbe906bd6f3be8a946eea8682ff5 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 30 Apr 2019 19:03:18 +0200 Subject: [PATCH] copying: make M-6 do nothing when at end of buffer --- src/cut.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cut.c b/src/cut.c index b3d9d7d1..66e0f177 100644 --- a/src/cut.c +++ b/src/cut.c @@ -408,6 +408,10 @@ void do_copy_text(void) ssize_t is_current_lineno = openfile->current->lineno; size_t is_current_x = openfile->current_x; + /* If there is nothing to copy, don't even try. */ + if (openfile->current->next == NULL && openfile->current->data[0] == '\0') + return; + if (mark_is_set || openfile->current != next_contiguous_line) keep_cutbuffer = FALSE;