Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/usr.bin/gzip Pull up revision 1.4 (requested by mrg in ...



details:   https://anonhg.NetBSD.org/src/rev/40e08fe5c51f
branches:  netbsd-2-0
changeset: 561229:40e08fe5c51f
user:      tron <tron%NetBSD.org@localhost>
date:      Sun May 30 14:48:27 2004 +0000

description:
Pull up revision 1.4 (requested by mrg in ticket #420):
- fix "gzip -t" to not output anything by default.  PR#25507
- fix any decompression on corrupted gzip files.  PR#25508
- ask to overwrite files if we have a tty, rather than failing the
  operation.  PR#25509.
- clean up maybe_err()/maybe_warn(): use maybe_err() only for fatal
  errors.  maybe_warn() is for processing errors.  this allows
  "gzip -d file1.gz file2.gz" to decompress file2.gz even if file1.gz
  is corrupted, etc.
- change the internal compressor/decompressor API to return "-1" on
  failure, not 0.  this allows for 0-sized files to be decompressed
  correctly.

diffstat:

 usr.bin/gzip/zuncompress.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r bf465fb7d758 -r 40e08fe5c51f usr.bin/gzip/zuncompress.c
--- a/usr.bin/gzip/zuncompress.c        Sun May 30 14:48:21 2004 +0000
+++ b/usr.bin/gzip/zuncompress.c        Sun May 30 14:48:27 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zuncompress.c,v 1.2.2.1 2004/04/29 04:48:44 jmc Exp $ */
+/*     $NetBSD: zuncompress.c,v 1.2.2.2 2004/05/30 14:48:27 tron Exp $ */
 
 /*-
  * Copyright (c) 1985, 1986, 1992, 1993
@@ -143,7 +143,7 @@
 
        while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) {
                if (fwrite(buf, 1, bin, out) != bin)
-                       return 0;
+                       return -1;
                bout += bin;
        }
 



Home | Main Index | Thread Index | Old Index