summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-11-09 01:53:54 +0000
committerdelphij <delphij@FreeBSD.org>2015-11-09 01:53:54 +0000
commite81257014289b0a30dd6a411bd6b39283e641ed2 (patch)
tree5e4a227c5f7dad3f83578be9ba9380dce073e2cb /usr.bin
parentfab4b61ecb5b09be18208a5e7896d344b7536089 (diff)
downloadFreeBSD-src-e81257014289b0a30dd6a411bd6b39283e641ed2.zip
FreeBSD-src-e81257014289b0a30dd6a411bd6b39283e641ed2.tar.gz
MFC r290024,290073:
In gunzip(1), treat trailing garbage as a warning and not an error. This allows scripts to distinguish it between real fatal errors, for instance a CRC mismatch. Update manual page for the behavior change. PR: bin/203873 Submitted by: Eugene Grosbein <eugen grosbein net>
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/gzip/gzip.114
-rw-r--r--usr.bin/gzip/gzip.c3
2 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/gzip/gzip.1 b/usr.bin/gzip/gzip.1
index 723c675..16a9035 100644
--- a/usr.bin/gzip/gzip.1
+++ b/usr.bin/gzip/gzip.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: gzip.1,v 1.25 2015/04/06 21:41:17 wiz Exp $
+.\" $NetBSD: gzip.1,v 1.26 2015/10/27 07:36:18 mrg Exp $
.\"
.\" Copyright (c) 1997, 2003, 2004 Matthew R. Green
.\" All rights reserved.
@@ -25,7 +25,7 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd April 6, 2015
+.Dd October 26, 2015
.Dt GZIP 1
.Os
.Sh NAME
@@ -136,7 +136,7 @@ option, allowing non-compressed data to pass through unchanged.
.It Fl h , -help
This option prints a usage summary and exits.
.It Fl k , -keep
-Keep (don't delete) input files during compression
+Keep (do not delete) input files during compression
or decompression.
.It Fl L , -license
This option prints
@@ -183,6 +183,12 @@ is set, it is parsed as a white-space separated list of options
handled before any options on the command line.
Options on the command line will override anything in
.Ev GZIP .
+.Sh EXIT STATUS
+The
+.Nm
+utility exits 0 on success,
+1 on errors,
+and 2 if a warning occurs.
.Sh SEE ALSO
.Xr bzip2 1 ,
.Xr compress 1 ,
@@ -220,7 +226,7 @@ with unpack support written by
.An Xin LI Aq delphij@FreeBSD.org .
.Sh BUGS
According to RFC 1952, the recorded file size is stored in a 32-bit
-integer, therefore, it can not represent files larger than 4GB.
+integer, therefore, it cannot represent files larger than 4GB.
This limitation also applies to
.Fl l
option of
diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c
index 495392b..eba7a9d 100644
--- a/usr.bin/gzip/gzip.c
+++ b/usr.bin/gzip/gzip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gzip.c,v 1.108 2015/04/15 02:29:12 christos Exp $ */
+/* $NetBSD: gzip.c,v 1.109 2015/10/27 07:36:18 mrg Exp $ */
/*-
* Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green
@@ -810,6 +810,7 @@ gz_uncompress(int in, int out, char *pre, size_t prelen, off_t *gsizep,
if (in_tot > 0) {
maybe_warnx("%s: trailing garbage "
"ignored", filename);
+ exit_value = 2;
goto stop;
}
maybe_warnx("input not gziped (MAGIC0)");
OpenPOWER on IntegriCloud