From b847e7edf35fd9c2bcc3c31d0bfd1093204ede56 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 7 May 2007 23:24:54 +0000 Subject: [PATCH] * NEWS: 'gzip -f foo.gz' now works instead of complaining. * gzip.c (make_ofname): Implement this. Problem reported by Sven Hartrump in . * NEWS, gzip.1: Document that case is ignored when looking at file name extensions. * doc/gzip.texi (Overview): Likewise. --- ChangeLog | 11 +++++++++++ NEWS | 6 ++++++ doc/gzip.texi | 7 ++++--- gzip.1 | 2 +- gzip.c | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 063130e..9b60320 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-05-07 Paul Eggert + + * NEWS: 'gzip -f foo.gz' now works instead of complaining. + * gzip.c (make_ofname): Implement this. + Problem reported by Sven Hartrump in + . + + * NEWS, gzip.1: Document that case is ignored when looking at file name + extensions. + * doc/gzip.texi (Overview): Likewise. + 2007-05-04 Paul Eggert * Makefile.am (.in): Substitute @bindir@, not BINDIR, for diff --git a/NEWS b/NEWS index b809273..eda7683 100644 --- 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 diff --git a/doc/gzip.texi b/doc/gzip.texi index c7f8d62..a2c723e 100644 --- a/doc/gzip.texi +++ b/doc/gzip.texi @@ -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 784d828..bdf6943 100644 --- 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 131a65e..da64e37 100644 --- 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. */ -- 2.47.2