* NEWS: 'gzip -f foo.gz' now works instead of complaining.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 May 2007 23:24:54 +0000 (23:24 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 May 2007 23:24:54 +0000 (23:24 +0000)
* gzip.c (make_ofname): Implement this.
Problem reported by Sven Hartrump in
<http://lists.gnu.org/archive/html/bug-gzip/2007-05/msg00003.html>.

* NEWS, gzip.1: Document that case is ignored when looking at file name
extensions.
* doc/gzip.texi (Overview): Likewise.

ChangeLog
NEWS
doc/gzip.texi
gzip.1
gzip.c

index 063130ec66d671df9234af921628adf4abdcb8c7..9b603200e08249071e1dd20afaf9fd328e82f4c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-05-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * NEWS: 'gzip -f foo.gz' now works instead of complaining.
+       * gzip.c (make_ofname): Implement this.
+       Problem reported by Sven Hartrump in
+       <http://lists.gnu.org/archive/html/bug-gzip/2007-05/msg00003.html>.
+
+       * NEWS, gzip.1: Document that case is ignored when looking at file name
+       extensions.
+       * doc/gzip.texi (Overview): Likewise.
+
 2007-05-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        * Makefile.am (.in): Substitute @bindir@, not BINDIR, for
diff --git a/NEWS b/NEWS
index b809273a5efef6d6ab26cdca6bf092f811faaca7..eda76836adbd5ff7101cdbe88e858048100d19ba 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ Major changes in Gzip 1.3.12 (2007-04-13)
 
 * znew now uses $TMPDIR (default /tmp) instead of always using /tmp.
 
+* 'gzip -f foo.gz' now creates a file foo.gz.gz instead of complaining.
+
+* It is now documented that gzip ignores case when examining file name
+  extensions; for example, 'gzip test.Gz' (without -f) fails because
+  the file name ends in '.Gz'.
+
 Major changes in Gzip 1.3.11 (2007-02-05)
 
 * As per the GNU coding standards, the behavior of gzip and its
index c7f8d62ad94c338c02e09b95468663c169f17c59..a2c723eb2ece633ea97aded4007811fafe23e957 100644 (file)
@@ -80,7 +80,7 @@ Free Documentation License''.
 @command{gzip} reduces the size of the named files using Lempel-Ziv coding
 (LZ77).  Whenever possible, each file is replaced by one with the
 extension @samp{.gz}, while keeping the same ownership modes, access and
-modification times.  (The default extension is @option{-gz} for @abbr{VMS},
+modification times.  (The default extension is @samp{-gz} for @abbr{VMS},
 @samp{z} for @abbr{MSDOS}, @abbr{OS/2} @abbr{FAT} and Atari.)
 If no files are specified or
 if a file name is "-", the standard input is compressed to the standard
@@ -113,8 +113,9 @@ compressed file is not suitable for its file system, a new name is
 constructed from the original one to make it legal.
 
 @command{gunzip} takes a list of files on its command line and replaces
-each file whose name ends with @samp{.gz}, @samp{.z}, @samp{.Z},
-@option{-gz}, @option{-z} or @samp{_z} and which begins with the correct
+each file whose name ends with @samp{.gz}, @samp{.z}
+@samp{-gz}, @samp{-z}, or @samp{_z} (ignoring case)
+and which begins with the correct
 magic number with an uncompressed file without the original extension.
 @command{gunzip} also recognizes the special extensions @samp{.tgz} and
 @samp{.taz} as shorthands for @samp{.tar.gz} and @samp{.tar.Z}
diff --git a/gzip.1 b/gzip.1
index 784d8283e9765203bb51c08a15671ce0032de3ba..bdf69435c8c9ade9141b038a81e1445a82e898c0 100644 (file)
--- a/gzip.1
+++ b/gzip.1
@@ -72,7 +72,7 @@ legal.
 .PP
 .I gunzip
 takes a list of files on its command line and replaces each
-file whose name ends with .gz, -gz, .z, -z, _z or .Z
+file whose name ends with .gz, -gz, .z, -z, or _z (ignoring case)
 and which begins with the correct magic number with an uncompressed
 file without the original extension.
 .I gunzip
diff --git a/gzip.c b/gzip.c
index 131a65e90fb1107ae988e9f1ae1c538072471ce0..da64e37524a7c331f8c29f940e56abfa663ff783 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -1165,7 +1165,7 @@ local int make_ofname()
        }
         /* ofname might be changed later if infile contains an original name */
 
-    } else if (suff != NULL) {
+    } else if (suff && ! force) {
        /* Avoid annoying messages with -r (see treat_dir()) */
        if (verbose || (!recursive && !quiet)) {
            /* Don't use WARN, as it affects exit status.  */