diff options
author | kientzle <kientzle@FreeBSD.org> | 2009-03-07 02:51:18 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2009-03-07 02:51:18 +0000 |
commit | d60e57a219eff89b891ff20ee2f72fe1a63b7da2 (patch) | |
tree | 7b707b8720cfd2f82ce4f6af863d164facc1d1b0 /lib | |
parent | de0aeab80c92bfc883421689bda9e9d45a532e29 (diff) | |
download | FreeBSD-src-d60e57a219eff89b891ff20ee2f72fe1a63b7da2.zip FreeBSD-src-d60e57a219eff89b891ff20ee2f72fe1a63b7da2.tar.gz |
Merge r585,r669 from libarchive.googlecode.com: If zlib is unavailable,
use external "gunzip" instead. With this in place, we can unconditionally
enable gzip read support.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libarchive/archive_read_support_compression_all.c | 3 | ||||
-rw-r--r-- | lib/libarchive/archive_read_support_compression_gzip.c | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/libarchive/archive_read_support_compression_all.c b/lib/libarchive/archive_read_support_compression_all.c index 967546d..745f1ff 100644 --- a/lib/libarchive/archive_read_support_compression_all.c +++ b/lib/libarchive/archive_read_support_compression_all.c @@ -36,9 +36,8 @@ archive_read_support_compression_all(struct archive *a) #endif /* The decompress code doesn't use an outside library. */ archive_read_support_compression_compress(a); -#if HAVE_ZLIB_H + /* Gzip decompress falls back to "gunzip" command-line. */ archive_read_support_compression_gzip(a); -#endif #if HAVE_LZMADEC_H /* LZMA bidding is subject to false positives because * the LZMA file format has a very weak signature. It diff --git a/lib/libarchive/archive_read_support_compression_gzip.c b/lib/libarchive/archive_read_support_compression_gzip.c index 9d06bf6..bc3f143 100644 --- a/lib/libarchive/archive_read_support_compression_gzip.c +++ b/lib/libarchive/archive_read_support_compression_gzip.c @@ -91,7 +91,7 @@ archive_read_support_compression_gzip(struct archive *_a) bidder->bid = gzip_bidder_bid; bidder->init = gzip_bidder_init; bidder->options = NULL; - bidder->free = NULL; + bidder->free = NULL; /* No data, so no cleanup necessary. */ return (ARCHIVE_OK); } @@ -212,12 +212,14 @@ gzip_bidder_bid(struct archive_read_filter_bidder *self, * and emit a useful message. */ static int -gzip_bidder_init(struct archive_read_filter *filter) +gzip_bidder_init(struct archive_read_filter *self) { + int r; - archive_set_error(&filter->archive->archive, -1, - "This version of libarchive was compiled without gzip support"); - return (ARCHIVE_FATAL); + r = __archive_read_program(self, "gunzip"); + self->code = ARCHIVE_COMPRESSION_GZIP; + self->name = "gzip"; + return (r); } #else |