zlib 1.2.0.8

This commit is contained in:
Mark Adler
2011-09-09 23:23:14 -07:00
parent b97ec631c6
commit a2506218cd
31 changed files with 1530 additions and 119 deletions

8
gzio.c
View File

@@ -889,7 +889,13 @@ int ZEXPORT gzeof (file)
{
gz_stream *s = (gz_stream*)file;
return (s == NULL || s->mode != 'r') ? 0 : s->z_eof;
/* With concatenated compressed files that can have embedded
* crc trailers, z_eof is no longer the only/best indicator of EOF
* on a gz_stream. Handle end-of-stream error explicitly here.
*/
if (s == NULL || s->mode != 'r') return 0;
if (s->z_eof) return 1;
return s->z_err == Z_STREAM_END;
}
/* ===========================================================================