aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_add_filter_gzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_add_filter_gzip.c')
-rw-r--r--libarchive/archive_write_add_filter_gzip.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libarchive/archive_write_add_filter_gzip.c b/libarchive/archive_write_add_filter_gzip.c
index 04eb06c1c06f..e4b3435e4206 100644
--- a/libarchive/archive_write_add_filter_gzip.c
+++ b/libarchive/archive_write_add_filter_gzip.c
@@ -226,7 +226,12 @@ archive_compressor_gzip_open(struct archive_write_filter *f)
data->compressed[7] = (uint8_t)(t>>24)&0xff;
} else
memset(&data->compressed[4], 0, 4);
- data->compressed[8] = 0; /* No deflate options */
+ if (data->compression_level == 9)
+ data->compressed[8] = 2;
+ else if(data->compression_level == 1)
+ data->compressed[8] = 4;
+ else
+ data->compressed[8] = 0;
data->compressed[9] = 3; /* OS=Unix */
data->stream.next_out += 10;
data->stream.avail_out -= 10;