aboutsummaryrefslogtreecommitdiffstats
path: root/gzlib.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2010-04-12 17:43:58 +0000
committerXin LI <delphij@FreeBSD.org>2010-04-12 17:43:58 +0000
commit1a0a89c328dc7176c2058e08087761d0b9957ff8 (patch)
tree12febbe1626e04bc0dd014c1019b5858090b3650 /gzlib.c
parenta665426b03b0f88ddb21074e5f760c8d3ba25fd1 (diff)
downloadsrc-vendor/zlib/1.2.4.3.tar.gz
src-vendor/zlib/1.2.4.3.zip
Import zlib 1.2.4.3 (trimmed).vendor/zlib/1.2.4.3
Diffstat (limited to 'gzlib.c')
-rw-r--r--gzlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gzlib.c b/gzlib.c
index 15999aee8b5a..183900269059 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -5,7 +5,7 @@
#include "gzguts.h"
-#if _LARGEFILE64_SOURCE == 1 && _LFS64_LARGEFILE == 1
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64
#else
# define LSEEK lseek
@@ -172,6 +172,7 @@ local gzFile gz_open(path, fd, mode)
O_APPEND))),
0666);
if (state->fd == -1) {
+ free(state->path);
free(state);
return NULL;
}
@@ -432,7 +433,8 @@ int ZEXPORT gzeof(file)
return 0;
/* return end-of-file state */
- return state->mode == GZ_READ ? (state->eof && state->have == 0) : 0;
+ return state->mode == GZ_READ ?
+ (state->eof && state->strm.avail_in == 0 && state->have == 0) : 0;
}
/* -- see zlib.h -- */