summaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/libarchive/archive_write_set_format_zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/libarchive/archive_write_set_format_zip.c')
-rw-r--r--src/libs/3rdparty/libarchive/archive_write_set_format_zip.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libs/3rdparty/libarchive/archive_write_set_format_zip.c b/src/libs/3rdparty/libarchive/archive_write_set_format_zip.c
index f4352d5a9..8c14a7027 100644
--- a/src/libs/3rdparty/libarchive/archive_write_set_format_zip.c
+++ b/src/libs/3rdparty/libarchive/archive_write_set_format_zip.c
@@ -740,12 +740,16 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
/* We may know the size, but never the CRC. */
zip->entry_flags |= ZIP_ENTRY_FLAG_LENGTH_AT_END;
} else {
- /* We don't know the size. In this case, we prefer
- * deflate (it has a clear end-of-data marker which
- * makes length-at-end more reliable) and will
- * enable Zip64 extensions unless we're told not to.
+ /* We don't know the size. Use the default
+ * compression unless specified otherwise.
+ * We enable Zip64 extensions unless we're told not to.
*/
- zip->entry_compression = COMPRESSION_DEFAULT;
+
+ zip->entry_compression = zip->requested_compression;
+ if(zip->entry_compression == COMPRESSION_UNSPECIFIED){
+ zip->entry_compression = COMPRESSION_DEFAULT;
+ }
+
zip->entry_flags |= ZIP_ENTRY_FLAG_LENGTH_AT_END;
if ((zip->flags & ZIP_FLAG_AVOID_ZIP64) == 0) {
zip->entry_uses_zip64 = 1;