diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-06 16:32:06 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-06 16:32:06 +0100 |
commit | 02c3c3842004d88207b46450dbd19f80e6596c7e (patch) | |
tree | 68890b6d081c3851b898f41bede25badc6b453fa /archival/libarchive | |
parent | 8a6a2f9c9c214b94bd945acd97ac8b28c25e194e (diff) | |
download | busybox-w32-02c3c3842004d88207b46450dbd19f80e6596c7e.tar.gz busybox-w32-02c3c3842004d88207b46450dbd19f80e6596c7e.tar.bz2 busybox-w32-02c3c3842004d88207b46450dbd19f80e6596c7e.zip |
Move seamless .Z support into unpack_gz_stream
unpack_gz_stream 566 643 +77
unpack_gunzip 123 12 -111
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive')
-rw-r--r-- | archival/libarchive/decompress_gunzip.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c index f1c9a79e5..66152a853 100644 --- a/archival/libarchive/decompress_gunzip.c +++ b/archival/libarchive/decompress_gunzip.c | |||
@@ -1188,8 +1188,26 @@ unpack_gz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) | |||
1188 | IF_DESKTOP(long long) int total, n; | 1188 | IF_DESKTOP(long long) int total, n; |
1189 | DECLARE_STATE; | 1189 | DECLARE_STATE; |
1190 | 1190 | ||
1191 | #if !ENABLE_FEATURE_SEAMLESS_Z | ||
1191 | if (check_signature16(aux, src_fd, GZIP_MAGIC)) | 1192 | if (check_signature16(aux, src_fd, GZIP_MAGIC)) |
1192 | return -1; | 1193 | return -1; |
1194 | #else | ||
1195 | if (aux && aux->check_signature) { | ||
1196 | uint16_t magic2; | ||
1197 | |||
1198 | if (full_read(STDIN_FILENO, &magic2, 2) != 2) { | ||
1199 | bad_magic: | ||
1200 | bb_error_msg("invalid magic"); | ||
1201 | return -1; | ||
1202 | } | ||
1203 | if (magic2 == COMPRESS_MAGIC) { | ||
1204 | aux->check_signature = 0; | ||
1205 | return unpack_Z_stream(aux, src_fd, dst_fd); | ||
1206 | } | ||
1207 | if (magic2 != GZIP_MAGIC) | ||
1208 | goto bad_magic; | ||
1209 | } | ||
1210 | #endif | ||
1193 | 1211 | ||
1194 | total = 0; | 1212 | total = 0; |
1195 | 1213 | ||