1From bba741ccd0f0a65cd9bfdd81504ebe5840fd37ad Mon Sep 17 00:00:00 2001
2From: Will Dietz <w@wdtz.org>
3Date: Tue, 22 Mar 2022 08:01:10 -0500
4Subject: [PATCH] pxz: flush stdout before exec'ing xz, ensure our messages are
5 printed
6
7Without this, they're presently dropped on my system when pxz
8is piped to something, as in `pxz --help|less` or `pxz --version|cat`.
9---
10 pxz.c | 2 ++
11 1 file changed, 2 insertions(+)
12
13diff --git a/pxz.c b/pxz.c
14index 4240b6e..3b53cfa 100644
15--- a/pxz.c
16+++ b/pxz.c
17@@ -184,10 +184,12 @@ void parse_args( int argc, char **argv, char **envp ) {
18 " -D, --context-size per-thread compression context size as a multiple\n"
19 " of dictionary size. Default is 3.\n\n"
20 "Usage and other options are same as in XZ:\n\n");
21+ fflush(stdout);
22 run_xz(argv, envp);
23 break;
24 case 'V':
25 printf("Parallel PXZ "PXZ_VERSION" (build "PXZ_BUILD_DATE")\n");
26+ fflush(stdout);
27 run_xz(argv, envp);
28 break;
29 case 'g':
30--
312.35.1
32