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

should not be recognized if there is a read error.
This commit is contained in:
Tim Kientzle 2009-04-12 04:45:40 +00:00
parent 8cf9d6cd7e
commit 0da7a22640

View File

@ -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);
}