diff options
| author | Tim Kientzle <kientzle@FreeBSD.org> | 2007-10-12 04:08:28 +0000 |
|---|---|---|
| committer | Tim Kientzle <kientzle@FreeBSD.org> | 2007-10-12 04:08:28 +0000 |
| commit | 04a832627bfa9c48eb8d7209f3e50180c16279b8 (patch) | |
| tree | eb261417a4541435fbd22cf3fd4a14c2edaee62b /lib/libarchive/archive_read_support_format_zip.c | |
| parent | 58d14dae6d809f669e1279e7d735c9cafe225823 (diff) | |
Notes
Diffstat (limited to 'lib/libarchive/archive_read_support_format_zip.c')
| -rw-r--r-- | lib/libarchive/archive_read_support_format_zip.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libarchive/archive_read_support_format_zip.c b/lib/libarchive/archive_read_support_format_zip.c index 80507bb4a479..b07e14e2165a 100644 --- a/lib/libarchive/archive_read_support_format_zip.c +++ b/lib/libarchive/archive_read_support_format_zip.c @@ -335,6 +335,10 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry, zip->entry_bytes_remaining = zip->compressed_size; zip->entry_offset = 0; + /* If there's no body, force read_data() to return EOF immediately. */ + if (zip->entry_bytes_remaining < 1) + zip->end_of_entry = 1; + /* Set up a more descriptive format name. */ sprintf(zip->format_name, "ZIP %d.%d (%s)", zip->version / 10, zip->version % 10, @@ -422,6 +426,9 @@ archive_read_format_zip_read_data(struct archive_read *a, /* End-of-entry cleanup done. */ zip->end_of_entry_cleanup = 1; } + *offset = zip->entry_uncompressed_bytes_read; + *size = 0; + *buff = NULL; return (ARCHIVE_EOF); } |
