X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fzlib-extra.c;h=3a75e50434b92b4ca1dd7d2fffed14e26fde40b8;hp=f691cccf2a336e5f2785a5daf8da7f8cc0612a25;hb=HEAD;hpb=1979145b91fa85d6952b94db561a46238265d910 diff --git a/util/zlib-extra.c b/util/zlib-extra.c index f691cccf..1f5f9dbe 100644 --- a/util/zlib-extra.c +++ b/util/zlib-extra.c @@ -47,6 +47,7 @@ gz_getline (void *talloc_ctx, char **bufptr, ssize_t *bytes_read, gzFile stream) int zlib_status = 0; (void) gzerror (stream, &zlib_status); switch (zlib_status) { + case Z_STREAM_END: case Z_OK: /* no data read before EOF */ if (offset == 0) @@ -80,7 +81,15 @@ const char * gz_error_string (util_status_t status, gzFile file) { if (status == UTIL_GZERROR) - return gzerror (file, NULL); + return gzerror_str (file); else return util_error_string (status); } + +const char * +gzerror_str (gzFile file) +{ + int dummy; + + return gzerror (file, &dummy); +}