if there are zero bytes to output, this isn't an error. it's probably

a zero length file.  don't return an error.  this should fix PR#25994.
This commit is contained in:
mrg 2004-06-22 12:01:29 +00:00
parent a3f45b38fe
commit 3c372acd10
1 changed files with 6 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: gzip.c,v 1.49 2004/06/07 03:24:01 mrg Exp $ */
/* $NetBSD: gzip.c,v 1.50 2004/06/22 12:01:29 mrg Exp $ */
/*
* Copyright (c) 1997, 1998, 2003, 2004 Matthew R. Green
@ -32,7 +32,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004 Matthew R. Green\n\
All rights reserved.\n");
__RCSID("$NetBSD: gzip.c,v 1.49 2004/06/07 03:24:01 mrg Exp $");
__RCSID("$NetBSD: gzip.c,v 1.50 2004/06/22 12:01:29 mrg Exp $");
#endif /* not lint */
/*
@ -749,17 +749,14 @@ gz_uncompress(int in, int out, char *pre, size_t prelen, off_t *gsizep,
case GZSTATE_READ:
error = inflate(&z, Z_FINISH);
/* Z_BUF_ERROR goes with Z_FINISH... */
if (error == Z_STREAM_END || error == Z_BUF_ERROR) {
size_t wr = BUFLEN - z.avail_out;
/*
* If there's nothing to output, we must
* have an error...
*/
if (wr == 0) {
out_tot = -1;
/* Nothing left? */
if (wr == 0)
goto stop;
}
if (
#ifndef SMALL
/* don't write anything with -t */