diff options
author | Jim Meyering <meyering@redhat.com> | 2010-02-20 11:07:55 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2010-02-22 14:42:54 +0100 |
commit | 884ef6d16c66835640cf0b3539a53e95cfed059c (patch) | |
tree | 7f006dba046175c5937d8f6a51c8b106374d5e62 /gzip.1 | |
parent | 3eb6091d69a73b5955bc9acf9ca507fc5f52f42c (diff) | |
download | gzip-884ef6d16c66835640cf0b3539a53e95cfed059c.tar.gz |
gzip: fix a data-loss bug when decompressing with --suffix=''
* gzip.c (main): Disallow an empty --suffix=S also with -d.
Otherwise, "gzip -d -S '' F.gz" would ask if it's ok to remove the
existing file, "F.gz"; if you reply "yes", you'd lose all of that data.
Use of an empty suffix was already rejected in compression mode.
* gzip.1 (--suffix (-S)): Do not recommend to use "gunzip -S '' *".
Describe how the suffix is used when decompressing, too.
* NEWS (Bug fixes): mention the fix.
Reported by Ripduman Sohan.
Diffstat (limited to 'gzip.1')
-rw-r--r-- | gzip.1 | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -291,15 +291,14 @@ will descend into the directory and compress all the files it finds there ). .TP .B \-S .suf --suffix .suf -Use suffix .suf instead of .gz. Any suffix can be given, but suffixes +When compressing, use suffix .suf instead of .gz. +Any non-empty suffix can be given, but suffixes other than .z and .gz should be avoided to avoid confusion when files -are transferred to other systems. A null suffix forces gunzip to try -decompression on all given files regardless of suffix, as in: +are transferred to other systems. - gunzip -S "" * (*.* for MSDOS) +When decompressing, add .suf to the beginning of the list of +suffixes to try, when deriving an output file name from an input file name. -Previous versions of gzip used -the .z suffix. This was changed to avoid a conflict with .IR pack "(1)". .TP .B \-t --test |