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.
This commit is contained in:
Benno Schulenberg 2020-03-02 13:29:07 +01:00
parent 5c6fe50487
commit 477a9b33b4
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}