]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge 2488: Deal with bzip2 before 1.0 by not using it.
authorJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Sat, 19 Jun 2010 13:14:17 +0000 (09:14 -0400)
committerJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Sat, 19 Jun 2010 13:14:17 +0000 (09:14 -0400)
SVN-Revision: 2489

libarchive/archive_read_support_compression_bzip2.c
libarchive/archive_read_support_format_xar.c
libarchive/archive_write_set_compression_bzip2.c

index 1e45f22023c4a9472a594f0715260ff4eb128237..8381c9a578c66e46928d97a7befbda3e61aa76a8 100644 (file)
@@ -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 */
index b914975423d5c1848b56fa7095804c9f311ae259..12f2089a3aeb5d6333344c96ddee2b188e10e1cf 100644 (file)
@@ -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,
index beb2379e5e4a93eae0ffe038b0636c13aa64e67e..626bbbc16ecf68ed0734e71de891b96021ac95a0 100644 (file)
@@ -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 */