[LIBXML2] Update to version 2.9.8. CORE-15280

This commit is contained in:
Thomas Faber 2018-12-01 11:57:57 +01:00
parent 61fed54064
commit 5bb277a54b
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
37 changed files with 545 additions and 493 deletions

View file

@ -31,10 +31,10 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
#include <zlib.h>
#endif
#ifdef HAVE_LZMA_H
#ifdef LIBXML_LZMA_ENABLED
#include <lzma.h>
#endif
@ -76,7 +76,7 @@ typedef struct {
char padding1[32]; /* padding allowing to cope with possible
extensions of above structure without
too much side effect */
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
/* zlib inflate or deflate stream */
z_stream zstrm; /* stream structure in-place (not a pointer) */
#endif
@ -130,7 +130,7 @@ xz_reset(xz_statep state)
xz_error(state, LZMA_OK, NULL); /* clear error */
state->pos = 0; /* no uncompressed data yet */
state->strm.avail_in = 0; /* no input data yet */
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
state->zstrm.avail_in = 0; /* no input data yet */
#endif
}
@ -272,7 +272,7 @@ xz_avail(xz_statep state)
return 0;
}
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
static int
xz_avail_zstrm(xz_statep state)
{
@ -349,7 +349,7 @@ is_format_lzma(xz_statep state)
return 1;
}
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
/* Get next byte from input, or -1 if end or error. */
#define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \
@ -415,7 +415,7 @@ xz_head(xz_statep state)
xz_error(state, LZMA_MEM_ERROR, "out of memory");
return -1;
}
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
/* allocate inflate memory */
state->zstrm.zalloc = Z_NULL;
state->zstrm.zfree = Z_NULL;
@ -449,7 +449,7 @@ xz_head(xz_statep state)
state->direct = 0;
return 0;
}
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
/* look for the gzip magic header bytes 31 and 139 */
if (strm->next_in[0] == 31) {
strm->avail_in--;
@ -550,7 +550,7 @@ xz_decomp(xz_statep state)
action = LZMA_FINISH;
/* decompress and handle errors */
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
if (state->how == GZIP) {
state->zstrm.avail_in = (uInt) state->strm.avail_in;
state->zstrm.next_in = (Bytef *) state->strm.next_in;
@ -592,13 +592,13 @@ xz_decomp(xz_statep state)
/* update available output and crc check value */
state->have = had - strm->avail_out;
state->next = strm->next_out - state->have;
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
state->zstrm.adler =
crc32(state->zstrm.adler, state->next, state->have);
#endif
if (ret == LZMA_STREAM_END) {
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
if (state->how == GZIP) {
if (gz_next4(state, &crc) == -1 || gz_next4(state, &len) == -1) {
xz_error(state, LZMA_DATA_ERROR, "unexpected end of file");
@ -788,7 +788,7 @@ __libxml2_xzclose(xzFile file)
/* free memory and close file */
if (state->size) {
lzma_end(&(state->strm));
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_ZLIB_ENABLED
if (state->init == 1)
inflateEnd(&(state->zstrm));
state->init = 0;