commit 8f6559828d13a2bbb6b8e4ae05530f8db677e24e
parent 619962ee1895efc1f5b1ea19c8098d48c78e93ca
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 29 Mar 2020 18:02:02 +0200
files: make filtering of the entire buffer into a new buffer work again
This fixes https://savannah.gnu.org/bugs/?58076.
Bug existed since version 4.9, commit 477a9b33.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/files.c b/src/files.c
@@ -1036,6 +1036,8 @@ bool execute_command(const char *command)
/* If the command starts with "|", pipe buffer or region to the command. */
if (should_pipe) {
linestruct *was_cutbuffer = cutbuffer;
+ bool whole_buffer = FALSE;
+
cutbuffer = NULL;
#ifdef ENABLE_MULTIBUFFER
@@ -1043,6 +1045,8 @@ bool execute_command(const char *command)
openfile = openfile->prev;
if (openfile->mark)
do_snip(TRUE, TRUE, FALSE, FALSE);
+ else
+ whole_buffer = TRUE;
} else
#endif
{
@@ -1059,7 +1063,7 @@ bool execute_command(const char *command)
/* Create a separate process for piping the data to the command. */
if (fork() == 0) {
- send_data(cutbuffer, to_fd[1]);
+ send_data(whole_buffer ? openfile->filetop : cutbuffer, to_fd[1]);
exit(0);
}