summaryrefslogtreecommitdiff
path: root/gzio.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:23:14 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:23:14 -0700
commita2506218cd8c32416d0d15260834f3c23d910fc8 (patch)
tree25bbd63d92473c8ae02a27cce3fc7c04a6aba64a /gzio.c
parentb97ec631c6f7dd9cff2e3caf3b38e70b006e1b2d (diff)
downloadzlib-1.2.0.8.tar.gz
zlib-1.2.0.8.tar.bz2
zlib-1.2.0.8.zip
zlib 1.2.0.8v1.2.0.8
Diffstat (limited to '')
-rw-r--r--gzio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gzio.c b/gzio.c
index 441560e..4afd102 100644
--- a/gzio.c
+++ b/gzio.c
@@ -889,7 +889,13 @@ int ZEXPORT gzeof (file)
889{ 889{
890 gz_stream *s = (gz_stream*)file; 890 gz_stream *s = (gz_stream*)file;
891 891
892 return (s == NULL || s->mode != 'r') ? 0 : s->z_eof; 892 /* With concatenated compressed files that can have embedded
893 * crc trailers, z_eof is no longer the only/best indicator of EOF
894 * on a gz_stream. Handle end-of-stream error explicitly here.
895 */
896 if (s == NULL || s->mode != 'r') return 0;
897 if (s->z_eof) return 1;
898 return s->z_err == Z_STREAM_END;
893} 899}
894 900
895/* =========================================================================== 901/* ===========================================================================