From: Tim Kientzle Date: Sun, 11 Apr 2010 21:16:38 +0000 (-0400) Subject: Don't bother trying to write data into a zero-sized file. X-Git-Tag: v3.0.0a~1116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5ceaed244db4eaba20a456e23bc78fa10ba2e2d;p=thirdparty%2Flibarchive.git Don't bother trying to write data into a zero-sized file. SVN-Revision: 2232 --- diff --git a/libarchive/archive_read_extract.c b/libarchive/archive_read_extract.c index e45729934..211de0208 100644 --- a/libarchive/archive_read_extract.c +++ b/libarchive/archive_read_extract.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.61 2008/05/26 #endif #include "archive.h" +#include "archive_entry.h" #include "archive_private.h" #include "archive_read_private.h" #include "archive_write_disk_private.h" @@ -107,7 +108,7 @@ archive_read_extract2(struct archive *_a, struct archive_entry *entry, if (r != ARCHIVE_OK) /* If _write_header failed, copy the error. */ archive_copy_error(&a->archive, ad); - else + else if (archive_entry_size(entry) > 0) /* Otherwise, pour data into the entry. */ r = copy_data(_a, ad); r2 = archive_write_finish_entry(ad);