diff options
| author | Tim Kientzle <kientzle@FreeBSD.org> | 2009-12-28 03:11:36 +0000 |
|---|---|---|
| committer | Tim Kientzle <kientzle@FreeBSD.org> | 2009-12-28 03:11:36 +0000 |
| commit | 966062dd11eeec15b8c474a33e5df58636302669 (patch) | |
| tree | 0f451b758de2820e21f73a176d68c832323cbff1 /lib/libarchive/archive_read_support_format_zip.c | |
| parent | 10f117ebc2abdbda42cf82e716bcb28c0709652b (diff) | |
Notes
Diffstat (limited to 'lib/libarchive/archive_read_support_format_zip.c')
| -rw-r--r-- | lib/libarchive/archive_read_support_format_zip.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libarchive/archive_read_support_format_zip.c b/lib/libarchive/archive_read_support_format_zip.c index ccb675d36749..4a24cc80930b 100644 --- a/lib/libarchive/archive_read_support_format_zip.c +++ b/lib/libarchive/archive_read_support_format_zip.c @@ -36,10 +36,6 @@ __FBSDID("$FreeBSD$"); #include <time.h> #ifdef HAVE_ZLIB_H #include <zlib.h> -#else -/* Hmmm... This is necessary, but means that we can't correctly extract - * even uncompressed entries on platforms that lack zlib. */ -#define crc32(crc, buf, len) (unsigned long)0 #endif #include "archive.h" @@ -48,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include "archive_read_private.h" #include "archive_endian.h" +#ifndef HAVE_ZLIB_H +#include "archive_crc32.h" +#endif + struct zip { /* entry_bytes_remaining is the number of bytes we expect. */ int64_t entry_bytes_remaining; @@ -540,8 +540,7 @@ archive_read_format_zip_read_data(struct archive_read *a, return (r); /* Update checksum */ if (*size) - zip->entry_crc32 = - crc32(zip->entry_crc32, *buff, *size); + zip->entry_crc32 = crc32(zip->entry_crc32, *buff, *size); /* If we hit the end, swallow any end-of-data marker. */ if (zip->end_of_entry) { if (zip->flags & ZIP_LENGTH_AT_END) { |
