archive_read_support_format_zip() because of a bug in how the
read-ahead logic handled read(0) requests. Change the compat_zip test
to exercise this case and fix the underlying bug.
Thanks to: Ed Schouten and Roman Divacky
SVN-Revision: 1441
for (;;) {
/*
- * If we can satisfy from the copy buffer, we're done.
+ * If we can satisfy from the copy buffer (and the
+ * copy buffer isn't empty), we're done. In particular,
+ * note that min == 0 is a perfectly well-defined
+ * request.
*/
- if (filter->avail >= min) {
+ if (filter->avail >= min && filter->avail > 0) {
if (avail != NULL)
*avail = filter->avail;
return (filter->next);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));