Merge r881 from libarchive.googlecode.com: The "empty" format

should not be recognized if there is a read error.
This commit is contained in:
kientzle 2009-04-12 04:45:40 +00:00
parent 32d233ecc5
commit f3675e5a86

@ -60,9 +60,10 @@ static int
archive_read_format_empty_bid(struct archive_read *a)
{
const void *h;
ssize_t avail;
h = __archive_read_ahead(a, 1, NULL);
if (h != NULL)
h = __archive_read_ahead(a, 1, &avail);
if (avail != 0)
return (-1);
return (1);
}