From a560025c0cbf9d99d1c8746e19d2ae7203e14e57 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Tue, 3 Jun 2014 15:45:41 +0800 Subject: [PATCH] Fix $kill to cover at most first 127 characters of kill buffer. Was only first N % 250 (ex 25 out of 275). --- line.c | 2 +- tststr.cmd | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/line.c b/line.c index 02eb65d..e0fa6ed 100644 --- a/line.c +++ b/line.c @@ -63,7 +63,7 @@ char *getkill( void) value[0] = 0; else { /* copy in the contents... */ - if (kused < NSTRING) + if( kbufh == kbufp && kused < NSTRING) size = kused; else size = NSTRING - 1; diff --git a/tststr.cmd b/tststr.cmd index 988a4b0..9f524b1 100644 --- a/tststr.cmd +++ b/tststr.cmd @@ -33,5 +33,18 @@ insert-string &cat "Filename: " $cfname newline insert-string "Filename length: " insert-string &len $cfname +end-of-file +; Create a line longer than 1 kill block (250), 2 * 127 + 21 = 255 +insert-string 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +insert-string 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +insert-string "#12345678901234567890" +; kill and yank +beginning-of-line +kill-to-end-of-line +yank +newline +; insert kill variable (up to 127 characters), was 25 before fix +insert-string $kill save-file beginning-of-file +