GNU bug report logs - #32815
Corrective patch for GNU gzip

Previous Next

Package: gzip;

Reported by: Manfred Morgner <manfred.morgner <at> gmail.com>

Date: Sun, 23 Sep 2018 22:55:01 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Manfred Morgner <manfred.morgner <at> gmail.com>
To: 32815 <at> debbugs.gnu.org
Subject: bug#32815: Corrective patch for GNU gzip
Date: Sun, 23 Sep 2018 22:35:05 +0200
[Message part 1 (text/plain, inline)]
Hello all,
the manual page of GNU gzip says:
------------------------------DIAGNOSTICS       Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.------------------------------
This is not the case sind version >1.5 for the situation when the source file already ends with .gz 
Test:
$ gzip 2018.gzgzip: 2018.gz already has .gz suffix -- unchanged$ echo $?0
Following the patch for it:
diff --git a/gzip.c b/gzip.cindex e6a7761..bf3eb0a 100644--- a/gzip.c+++ b/gzip.c@@ -1417,8 +1417,8 @@ local int make_ofname()         /* Avoid annoying messages with -r (see treat_dir()) */         if (verbose || (!recursive && !quiet)) {             /* Don't use WARN, as it affects exit status.  */-            fprintf (stderr, "%s: %s already has %s suffix -- unchanged\n",-                     program_name, ifname, suff);+            WARN ((stderr, "%s: %s already has %s suffix -- unchanged\n",+                     program_name, ifname, suff));         }         return WARNING;     } else {
Test:
$ gzip 2018.gzgzip: 2018.gz already has .gz suffix -- unchanged$ echo $?2
Best regards,Manfred
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.