From 82ea3751d6769b4740365d78e39667681ebf25b4 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Fri, 17 Apr 2009 01:00:11 +0000 Subject: Don't match an empty file on a read error. --- lib/libarchive/archive_read_support_format_empty.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/libarchive/archive_read_support_format_empty.c') diff --git a/lib/libarchive/archive_read_support_format_empty.c b/lib/libarchive/archive_read_support_format_empty.c index db24d9dae4d3c..38498cf7ff3dd 100644 --- a/lib/libarchive/archive_read_support_format_empty.c +++ b/lib/libarchive/archive_read_support_format_empty.c @@ -59,14 +59,13 @@ archive_read_support_format_empty(struct archive *_a) static int archive_read_format_empty_bid(struct archive_read *a) { + const void *h; ssize_t avail; - (void)__archive_read_ahead(a, 1, &avail); - /* Bid 1 if we successfully read exactly zero bytes. */ - if (avail == 0) - return (1); - /* Otherwise, we don't bid on this. */ - return (-1); + h = __archive_read_ahead(a, 1, &avail); + if (avail != 0) + return (-1); + return (1); } static int -- cgit v1.3