Fork 0

gzip_read: always call gzclearerr

This is necessary when using a POSIX-compliant stdio implementation, which
will set the FILE error flag when input from the pipe is exhausted, causing
all subsequent reads to fail.
This commit is contained in:
Rich Felker 2006-11-05 04:53:42 +00:00 committed by Miciah Dashiel Butler Masters
parent dfbbde1952
commit d2b8e06f41
1 changed files with 1 additions and 0 deletions

View File

@ -33,6 +33,7 @@ gzip_open(struct stream_encoded *stream, int fd)
static int
gzip_read(struct stream_encoded *stream, unsigned char *data, int len)
gzclearerr((gzFile *) stream->data);
return gzread((gzFile *) stream->data, data, len);