From: Tim Kientzle Date: Fri, 30 Dec 2011 23:50:40 +0000 (-0500) Subject: Issue 218: Suppress extracting the body only if we know the body has X-Git-Tag: v3.0.4~2^2~238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8399c672c418fcfffa6c91022501d232e730647;p=thirdparty%2Flibarchive.git Issue 218: Suppress extracting the body only if we know the body has zero size. If we don't know the size, we have to proceed as if it is non-zero. This manifests as empty bodies when extracting Zip archives using length-at-end semantics from a pipe using bsdcpio. SVN-Revision: 4047 --- diff --git a/cpio/cpio.c b/cpio/cpio.c index ff5a1c600..025c50cfa 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -891,7 +891,8 @@ mode_in(struct cpio *cpio) fprintf(stderr, "%s: %s\n", archive_entry_pathname(entry), archive_error_string(ext)); - } else if (archive_entry_size(entry) > 0) { + } else if (!archive_entry_size_is_set(entry) + || archive_entry_size(entry) > 0) { r = extract_data(a, ext); if (r != ARCHIVE_OK) cpio->return_value = 1;