zlib 1.2.4.1

This commit is contained in:
Mark Adler
2011-09-09 23:34:22 -07:00
parent a1141160bc
commit 05d47d2627
30 changed files with 248 additions and 130 deletions

10
gzlib.c
View File

@@ -5,7 +5,7 @@
#include "gzguts.h"
#ifdef _LARGEFILE64_SOURCE
#if _LARGEFILE64_SOURCE == 1 && _LFS64_LARGEFILE == 1
# define LSEEK lseek64
#else
# define LSEEK lseek
@@ -15,7 +15,7 @@
local void gz_reset OF((gz_statep));
local gzFile gz_open OF((const char *, int, const char *));
#if defined UNDER_CE && defined NO_ERRNO_H
#if defined UNDER_CE
/* Map the Windows error number in ERROR to a locale-dependent error message
string and return a pointer to it. Typically, the values for ERROR come
@@ -65,7 +65,7 @@ char ZEXPORT *gz_strwinerror (error)
return buf;
}
#endif /* UNDER_CE && NO_ERRNO_H */
#endif /* UNDER_CE */
/* Reset gzip file state */
local void gz_reset(state)
@@ -217,7 +217,7 @@ gzFile ZEXPORT gzdopen(fd, mode)
if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL)
return NULL;
sprintf(path, "<fd:%d>", fd);
sprintf(path, "<fd:%d>", fd); /* for debugging */
gz = gz_open(path, fd, mode);
free(path);
return gz;
@@ -305,7 +305,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
/* if within raw area while reading, just go there */
if (state->mode == GZ_READ && state->how == COPY &&
state->pos + offset >= state->raw) {
ret = LSEEK(state->fd, offset, SEEK_CUR);
ret = LSEEK(state->fd, offset - state->have, SEEK_CUR);
if (ret == -1)
return -1;
state->have = 0;