diff --git a/src/text.c b/src/text.c index 96039651..b0bf695a 100644 --- a/src/text.c +++ b/src/text.c @@ -1241,8 +1241,11 @@ bool execute_command(const char *command) openfile->undotop->strdata = mallocstrcpy(NULL, _("filtering")); } + /* Wait for the external command (and possibly data sender) to terminate. */ if (wait(NULL) == -1) nperror("wait"); + if (should_pipe && (wait(NULL) == -1)) + nperror("wait"); /* If it was changed, restore the handler for SIGINT. */ if (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1)