* gzip.c (treat_stdin): If quiet, be quiet with plain gzip -q.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Nov 2011 17:35:00 +0000 (10:35 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Nov 2011 17:35:26 +0000 (10:35 -0700)
Problem reported by MichaĆ«l Guitton in
<http://lists.gnu.org/archive/html/bug-gzip/2011-11/msg00000.html>.

gzip.c

diff --git a/gzip.c b/gzip.c
index 61644381c1f7f7be7023d2d89e7c6770cd59f885..cb10a232b65b79c4a78e219f307417daa8fd8f12 100644 (file)
--- 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);
     }