From: Joerg Sonnenberger Date: Sat, 19 Jun 2010 13:14:17 +0000 (-0400) Subject: Merge 2488: Deal with bzip2 before 1.0 by not using it. X-Git-Tag: v2.8.4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d13fa6d39ea2c8feac1c4f53d32e2c34cdf33009;p=thirdparty%2Flibarchive.git Merge 2488: Deal with bzip2 before 1.0 by not using it. SVN-Revision: 2489 --- diff --git a/libarchive/archive_read_support_compression_bzip2.c b/libarchive/archive_read_support_compression_bzip2.c index 1e45f2202..8381c9a57 100644 --- a/libarchive/archive_read_support_compression_bzip2.c +++ b/libarchive/archive_read_support_compression_bzip2.c @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_compression_bzip2.c #include "archive_private.h" #include "archive_read_private.h" -#if HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) struct private_data { bz_stream stream; char *out_block; @@ -86,7 +86,7 @@ archive_read_support_compression_bzip2(struct archive *_a) reader->init = bzip2_reader_init; reader->options = NULL; reader->free = bzip2_reader_free; -#if HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, @@ -146,7 +146,7 @@ bzip2_reader_bid(struct archive_read_filter_bidder *self, struct archive_read_fi return (bits_checked); } -#ifndef HAVE_BZLIB_H +#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) /* * If we don't have the library on this system, we can't actually do the @@ -350,4 +350,4 @@ bzip2_filter_close(struct archive_read_filter *self) return (ret); } -#endif /* HAVE_BZLIB_H */ +#endif /* HAVE_BZLIB_H && BZ_CONFIG_ERROR */ diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c index b91497542..12f2089a3 100644 --- a/libarchive/archive_read_support_format_xar.c +++ b/libarchive/archive_read_support_format_xar.c @@ -323,7 +323,7 @@ struct xar { enum enctype rd_encoding; z_stream stream; int stream_valid; -#ifdef HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) bz_stream bzstream; int bzstream_valid; #endif @@ -1323,7 +1323,7 @@ decompression_init(struct archive_read *a, enum enctype encoding) xar->stream.total_in = 0; xar->stream.total_out = 0; break; -#ifdef HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) case BZIP2: if (xar->bzstream_valid) { BZ2_bzDecompressEnd(&(xar->bzstream)); @@ -1436,7 +1436,7 @@ decompression_init(struct archive_read *a, enum enctype encoding) * Unsupported compression. */ default: -#ifndef HAVE_BZLIB_H +#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) @@ -1496,7 +1496,7 @@ decompress(struct archive_read *a, const void **buff, size_t *outbytes, *used = avail_in - xar->stream.avail_in; *outbytes = avail_out - xar->stream.avail_out; break; -#ifdef HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) case BZIP2: xar->bzstream.next_in = (char *)(uintptr_t)b; xar->bzstream.avail_in = avail_in; @@ -1587,7 +1587,7 @@ decompress(struct archive_read *a, const void **buff, size_t *outbytes, *outbytes = avail_out - xar->lzstream.avail_out; break; #endif -#ifndef HAVE_BZLIB_H +#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) @@ -1630,7 +1630,7 @@ decompression_cleanup(struct archive_read *a) r = ARCHIVE_FATAL; } } -#ifdef HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) if (xar->bzstream_valid) { if (BZ2_bzDecompressEnd(&(xar->bzstream)) != BZ_OK) { archive_set_error(&a->archive, diff --git a/libarchive/archive_write_set_compression_bzip2.c b/libarchive/archive_write_set_compression_bzip2.c index beb2379e5..626bbbc16 100644 --- a/libarchive/archive_write_set_compression_bzip2.c +++ b/libarchive/archive_write_set_compression_bzip2.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_bzip2.c 20 #include "archive_private.h" #include "archive_write_private.h" -#ifndef HAVE_BZLIB_H +#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) int archive_write_set_compression_bzip2(struct archive *a) { @@ -405,4 +405,4 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish } } -#endif /* HAVE_BZLIB_H */ +#endif /* HAVE_BZLIB_H && BZ_CONFIG_ERROR */