Paul Eggert wrote: > I'm afraid that script is busted. It should use xargs -r. > You can see the bug by running the script with stdout > not being a terminal -- the script will send garbage to stdout. > > That being said, the FreeBSD behavior sounds a bit > more useful, so I installed the following patch, and > the new behavior should be in the next version of GNU gzip. > >>From 749cadea46b273be2acb50189341df1cf6a51492 Mon Sep 17 00:00:00 2001 > From: Paul Eggert <egg...@cs.ucla.edu> > Date: Wed, 2 Nov 2011 10:35:00 -0700 > Subject: [PATCH] * gzip.c (treat_stdin): If quiet, be quiet with plain gzip > -q. > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > Problem reported by Michaël Guitton in > <http://lists.gnu.org/archive/html/bug-gzip/2011-11/msg00000.html>. > --- > gzip.c | 14 +++++++++----- > 1 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/gzip.c b/gzip.c > index 6164438..cb10a23 100644 > --- a/gzip.c > +++ b/gzip.c > @@ -617,11 +617,15 @@ local void treat_stdin() > * > * Here we use the --force option to get the other behavior. > */ > - fprintf(stderr, > - "%s: compressed data not %s a terminal. Use -f to force > %scompression.\n", > - program_name, decompress ? "read from" : "written to", > - decompress ? "de" : ""); > - fprintf (stderr, "For help, type: %s -h\n", program_name); > + if (! quiet) > + fprintf (stderr, > + ("%s: compressed data not %s a terminal." > + " Use -f to force %scompression.\n" > + "For help, type: %s -h\n"), > + program_name, > + decompress ? "read from" : "written to", > + decompress ? "de" : "", > + program_name); > do_exit(ERROR); > }
Thanks, Paul. It's no big deal, but that broke "make distcheck", which happens to run "make syntax-check" and which checks for leading TABs. I fixed that with 1/3 below. That made me notice I'd fixed a minor bug in a test script back in July (2/3). And it's been a relatively long time since the last gnulib update, so I've done that, too (3/3). >From dd9cda0858dbe50fa638db267bdf63c77afc2c75 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Wed, 2 Nov 2011 18:47:50 +0100 Subject: [PATCH 1/3] maint: avoid "make syntax-check" failure * gzip.c (treat_stdin): Indent with spaces, not TABs. --- gzip.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gzip.c b/gzip.c index cb10a23..b454e6d 100644 --- a/gzip.c +++ b/gzip.c @@ -617,15 +617,15 @@ local void treat_stdin() * * Here we use the --force option to get the other behavior. */ - if (! quiet) - fprintf (stderr, - ("%s: compressed data not %s a terminal." - " Use -f to force %scompression.\n" - "For help, type: %s -h\n"), - program_name, - decompress ? "read from" : "written to", - decompress ? "de" : "", - program_name); + if (! quiet) + fprintf (stderr, + ("%s: compressed data not %s a terminal." + " Use -f to force %scompression.\n" + "For help, type: %s -h\n"), + program_name, + decompress ? "read from" : "written to", + decompress ? "de" : "", + program_name); do_exit(ERROR); } -- 1.7.8.rc0.32.g87bf9 >From 50a1a56051c77bd16f4a5c52f650c10ac8db57c2 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Sun, 24 Jul 2011 11:43:47 +0200 Subject: [PATCH 2/3] tests: mixed: correct size-enumeration logic * tests/mixed (sizes): Fix misplaced "&& break" that made us test only with a size of 0, rather than all sizes in 0..64. --- tests/mixed | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tests/mixed b/tests/mixed index bd561e8..22913df 100644 --- a/tests/mixed +++ b/tests/mixed @@ -48,7 +48,7 @@ in_str=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-+=% for i in 0 1 2 3 4 5 6 7 8 9 a; do in_str="$in_str$in_str" ;done # Start with some small sizes. $(seq 64) -sizes=$(i=0; while :; do echo $i; test $i = 64; i=$(expr $i + 1) && break; done) +sizes=$(i=0; while :; do echo $i; test $i = 64 && break; i=$(expr $i + 1); done) # gzip's internal buffer size is 32KiB + 64 bytes: sizes="$sizes 32831 32832 32833" -- 1.7.8.rc0.32.g87bf9 >From b477de776b18203341072692915a77c753db88a6 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Wed, 2 Nov 2011 18:41:11 +0100 Subject: [PATCH 3/3] build: update gnulib submodule to latest --- gnulib | 2 +- lib/.gitignore | 11 +++++++++++ m4/.gitignore | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletions(-) diff --git a/gnulib b/gnulib index 5b9e0c3..afe598a 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 5b9e0c3ce734b9d9b0c0001e31b65a8a4713700d +Subproject commit afe598a51a14e75cd697a30ac54fa9cc29c8cde0 diff --git a/lib/.gitignore b/lib/.gitignore index 61e76b1..9820da1 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -18,6 +18,7 @@ /close-stream.c /close-stream.h /close.c +/closedir.c /closein.c /closein.h /closeout.c @@ -27,6 +28,7 @@ /config.hin /configmake.h /creat-safer.c +/dirent-private.h /dirent.h /dirent.in.h /dirfd.c @@ -34,6 +36,7 @@ /dirname.h /dosname.h /dup-safer.c +/dup.c /dup2.c /errno.h /errno.in.h @@ -57,6 +60,7 @@ /fd-safer.c /fdopendir.c /fflush.c +/filename.h /filenamecat-lgpl.c /filenamecat.h /float+.h @@ -79,6 +83,7 @@ /fseeko.c /fseterr.c /fseterr.h +/fstat.c /fstatat.c /ftell.c /ftello.c @@ -105,6 +110,7 @@ /isnanl-nolibm.h /isnanl.c /iswblank.c +/itold.c /lchown.c /libgzip.a /localcharset.c @@ -122,6 +128,10 @@ /memrchr.c /mkdir.c /mkdirat.c +/msvc-inval.c +/msvc-inval.h +/msvc-nothrow.c +/msvc-nothrow.h /open-safer.c /open.c /openat-die.c @@ -129,6 +139,7 @@ /openat-proc.c /openat.c /openat.h +/opendir.c /pathmax.h /perror.c /pipe-safer.c diff --git a/m4/.gitignore b/m4/.gitignore index a566731..b3b29dc 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -9,6 +9,7 @@ /cloexec.m4 /close-stream.m4 /close.m4 +/closedir.m4 /closein.m4 /closeout.m4 /codeset.m4 @@ -19,6 +20,7 @@ /dirname.m4 /dos.m4 /double-slash-root.m4 +/dup.m4 /dup2.m4 /errno_h.m4 /error.m4 @@ -46,6 +48,7 @@ /frexpl.m4 /fseek.m4 /fseeko.m4 +/fstat.m4 /ftell.m4 /ftello.m4 /getcwd-abort-bug.m4 @@ -96,10 +99,13 @@ /mkdir.m4 /mmap-anon.m4 /mode_t.m4 +/msvc-inval.m4 +/msvc-nothrow.m4 /multiarch.m4 /nocrash.m4 /open.m4 /openat.m4 +/opendir.m4 /pathmax.m4 /perror.m4 /printf-frexp.m4 @@ -112,6 +118,7 @@ /save-cwd.m4 /signbit.m4 /size_max.m4 +/ssize_t.m4 /stat-time.m4 /stat.m4 /stdbool.m4 -- 1.7.8.rc0.32.g87bf9