Module Name: src
Committed By: mrg
Date: Tue Oct 27 07:36:18 UTC 2015
Modified Files:
src/usr.bin/gzip: gzip.1 gzip.c
Log Message:
port across the change from freebsd rev 290024:
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>
MFC after: 2 weeks
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/gzip/gzip.1
cvs rdiff -u -r1.108 -r1.109 src/usr.bin/gzip/gzip.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/gzip/gzip.1
diff -u src/usr.bin/gzip/gzip.1:1.25 src/usr.bin/gzip/gzip.1:1.26
--- src/usr.bin/gzip/gzip.1:1.25 Mon Apr 6 21:41:17 2015
+++ src/usr.bin/gzip/gzip.1 Tue Oct 27 07:36:18 2015
@@ -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.
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 6, 2015
+.Dd October 26, 2015
.Dt GZIP 1
.Os
.Sh NAME
@@ -169,6 +169,12 @@ is set, it is parsed as a white-space se
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 ,
Index: src/usr.bin/gzip/gzip.c
diff -u src/usr.bin/gzip/gzip.c:1.108 src/usr.bin/gzip/gzip.c:1.109
--- src/usr.bin/gzip/gzip.c:1.108 Wed Apr 15 02:29:12 2015
+++ src/usr.bin/gzip/gzip.c Tue Oct 27 07:36:18 2015
@@ -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
@@ -30,7 +30,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\
Matthew R. Green. All rights reserved.");
-__RCSID("$NetBSD: gzip.c,v 1.108 2015/04/15 02:29:12 christos Exp $");
+__RCSID("$NetBSD: gzip.c,v 1.109 2015/10/27 07:36:18 mrg Exp $");
#endif /* not lint */
/*
@@ -788,6 +788,7 @@ gz_uncompress(int in, int out, char *pre
goto stop;
}
maybe_warnx("input not gziped (MAGIC0)");
+ exit_value = 2;
goto stop_and_fail;
}
ADVANCE();