nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 477a9b33b4b6280f7c85c67f92063402df3c6627
parent 5c6fe5048778a3134a249c4264dd69cb1c088dc2
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  2 Mar 2020 13:29:07 +0100

files: when piping, always pipe whatever was cut to the external command

Either the marked region was cut (even when zero characters) or
the entire contents of the buffer were cut.  In both cases this
is what needs to be piped to the command.  That is: the contents
of the cutbuffer.

This fixes https://savannah.gnu.org/bugs/?57931.

Bug existed since version 2.9.8, commit f304b9ae,
when piping text to an external command was introduced.

Diffstat:
Msrc/text.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/text.c b/src/text.c @@ -1004,7 +1004,7 @@ bool execute_command(const char *command) /* Create a separate process for piping the data to the command. */ if (fork() == 0) { - send_data(cutbuffer != NULL ? cutbuffer : openfile->filetop, to_fd[1]); + send_data(cutbuffer, to_fd[1]); exit(0); }