From 5b9b31cc4237f558f84a99e26c931d7fe108a07b Mon Sep 17 00:00:00 2001 From: kientzle Date: Sun, 15 Apr 2007 01:01:20 +0000 Subject: Thanks to Colin for catching my mixup. The original problem wasn't suppressing the second error, it was failing to address the first. --- lib/libarchive/archive_read_extract.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index 2f0ba22..8828ec6 100644 --- a/lib/libarchive/archive_read_extract.c +++ b/lib/libarchive/archive_read_extract.c @@ -95,12 +95,17 @@ archive_read_extract(struct archive *_a, struct archive_entry *entry, int flags) archive_write_disk_set_skip_file(a->extract->ad, a->skip_file_dev, a->skip_file_ino); r = archive_write_header(a->extract->ad, entry); - if (r == ARCHIVE_OK) - /* If there's an FD, pour data into it. */ + if (r != ARCHIVE_OK) + /* If _write_header failed, copy the error. */ + archive_set_error(&a->archive, + archive_errno(extract->ad), + "%s", archive_error_string(extract->ad)); + else + /* Otherwise, pour data into the entry. */ r = copy_data(_a, a->extract->ad); r2 = archive_write_finish_entry(a->extract->ad); /* Use the first message. */ - if (r2 != ARCHIVE_OK || r != ARCHIVE_OK) + if (r2 != ARCHIVE_OK && r == ARCHIVE_OK) archive_set_error(&a->archive, archive_errno(extract->ad), "%s", archive_error_string(extract->ad)); -- cgit v1.1