diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-07 22:02:23 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-07 22:02:23 +0000 |
commit | ab9eef21a57c23567505e8fbceb8e5ea76306ce1 (patch) | |
tree | 800845b64d0e9a204743656c4d267cc6c9917cde /archival/libunarchive | |
parent | 8e858e2700651a0e973169b579622cd3dcd0defd (diff) | |
download | busybox-w32-ab9eef21a57c23567505e8fbceb8e5ea76306ce1.tar.gz busybox-w32-ab9eef21a57c23567505e8fbceb8e5ea76306ce1.tar.bz2 busybox-w32-ab9eef21a57c23567505e8fbceb8e5ea76306ce1.zip |
bunzip2/gunzip/uncompress/unlzma: merge into common code -
fix few corner cases, reduce size by 450 bytes. Update testsuite.
Diffstat (limited to 'archival/libunarchive')
-rw-r--r-- | archival/libunarchive/check_header_gzip.c | 9 | ||||
-rw-r--r-- | archival/libunarchive/get_header_tar_gz.c | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/archival/libunarchive/check_header_gzip.c b/archival/libunarchive/check_header_gzip.c index 0cfa94454..09cd6a94e 100644 --- a/archival/libunarchive/check_header_gzip.c +++ b/archival/libunarchive/check_header_gzip.c | |||
@@ -2,12 +2,11 @@ | |||
2 | /* | 2 | /* |
3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
4 | */ | 4 | */ |
5 | #include <stdlib.h> | 5 | |
6 | #include <unistd.h> | ||
7 | #include "libbb.h" | 6 | #include "libbb.h" |
8 | #include "unarchive.h" /* for external decl of check_header_gzip */ | 7 | #include "unarchive.h" /* for external decl of check_header_gzip_or_die */ |
9 | 8 | ||
10 | void check_header_gzip(int src_fd) | 9 | void check_header_gzip_or_die(int src_fd) |
11 | { | 10 | { |
12 | union { | 11 | union { |
13 | unsigned char raw[8]; | 12 | unsigned char raw[8]; |
@@ -57,6 +56,4 @@ void check_header_gzip(int src_fd) | |||
57 | xread_char(src_fd); | 56 | xread_char(src_fd); |
58 | xread_char(src_fd); | 57 | xread_char(src_fd); |
59 | } | 58 | } |
60 | |||
61 | return; | ||
62 | } | 59 | } |
diff --git a/archival/libunarchive/get_header_tar_gz.c b/archival/libunarchive/get_header_tar_gz.c index 41c02e16a..1f07e4e64 100644 --- a/archival/libunarchive/get_header_tar_gz.c +++ b/archival/libunarchive/get_header_tar_gz.c | |||
@@ -20,7 +20,7 @@ char get_header_tar_gz(archive_handle_t *archive_handle) | |||
20 | bb_error_msg_and_die("invalid gzip magic"); | 20 | bb_error_msg_and_die("invalid gzip magic"); |
21 | } | 21 | } |
22 | 22 | ||
23 | check_header_gzip(archive_handle->src_fd); | 23 | check_header_gzip_or_die(archive_handle->src_fd); |
24 | 24 | ||
25 | archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip); | 25 | archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip); |
26 | archive_handle->offset = 0; | 26 | archive_handle->offset = 0; |