struct zip *zip;
zip = (struct zip *)(a->format->data);
+ *offset = zip->entry_uncompressed_bytes_read;
+ *size = 0;
+ *buff = NULL;
- /*
- * If we hit end-of-entry last time, clean up and return
- * ARCHIVE_EOF this time.
- */
- if (zip->end_of_entry) {
- *offset = zip->entry_uncompressed_bytes_read;
- *size = 0;
- *buff = NULL;
+ /* If we hit end-of-entry last time, return ARCHIVE_EOF. */
+ if (zip->end_of_entry)
+ return (ARCHIVE_EOF);
+
+ /* Return EOF immediately if this is a non-regular file. */
+ if (AE_IFREG != (zip->entry->mode & AE_IFMT))
return (ARCHIVE_EOF);
- }
__archive_read_consume(a, zip->unconsumed);
zip->unconsumed = 0;
break;
#endif
default: /* Unsupported compression. */
- *buff = NULL;
- *size = 0;
- *offset = 0;
/* Return a warning. */
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Unsupported ZIP compression method (%s)",
}
}
- /* Return EOF immediately if this is a non-regular file. */
- if (AE_IFREG != (zip->entry->mode & AE_IFMT))
- return (ARCHIVE_EOF);
return (ARCHIVE_OK);
}
ssize_t bytes_avail;
zip = (struct zip *)(a->format->data);
- *_buff = NULL;
- *size = 0;
- *offset = zip->entry_uncompressed_bytes_read;
if (zip->entry->flags & ZIP_LENGTH_AT_END) {
const char *p;
zip->entry_bytes_remaining -= bytes_avail;
zip->entry_compressed_bytes_read += bytes_avail;
- *offset = zip->entry_uncompressed_bytes_read;
*size = zip->stream.total_out;
zip->entry_uncompressed_bytes_read += *size;
*buff = zip->uncompressed_buffer;