]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Don't bother trying to write data into a zero-sized file.
authorTim Kientzle <kientzle@gmail.com>
Sun, 11 Apr 2010 21:16:38 +0000 (17:16 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sun, 11 Apr 2010 21:16:38 +0000 (17:16 -0400)
SVN-Revision: 2232

libarchive/archive_read_extract.c

index e45729934281d932cc41c5864ea230b4c8f15200..211de02086760e547d89c85305c89715606038cb 100644 (file)
@@ -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);