diff options
Diffstat (limited to 'libbb/deb_extract.c')
-rw-r--r-- | libbb/deb_extract.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libbb/deb_extract.c b/libbb/deb_extract.c index e982c14bb..d3e615305 100644 --- a/libbb/deb_extract.c +++ b/libbb/deb_extract.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <fcntl.h> | 26 | #include <fcntl.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
29 | #include <string.h> | ||
29 | #include <signal.h> | 30 | #include <signal.h> |
30 | #include "libbb.h" | 31 | #include "libbb.h" |
31 | 32 | ||
@@ -42,14 +43,9 @@ extern int deb_extract(const char *package_filename, int function, char *target_ | |||
42 | case (extract_control): | 43 | case (extract_control): |
43 | ared_file = xstrdup("control.tar.gz"); | 44 | ared_file = xstrdup("control.tar.gz"); |
44 | break; | 45 | break; |
45 | case (extract_contents): | 46 | default: |
46 | case (extract_extract): | ||
47 | case (extract_verbose_extract): | ||
48 | case (extract_list): | ||
49 | ared_file = xstrdup("data.tar.gz"); | 47 | ared_file = xstrdup("data.tar.gz"); |
50 | break; | 48 | break; |
51 | default: | ||
52 | error_msg("Unknown extraction function"); | ||
53 | } | 49 | } |
54 | 50 | ||
55 | /* open the debian package to be worked on */ | 51 | /* open the debian package to be worked on */ |
@@ -71,9 +67,11 @@ extern int deb_extract(const char *package_filename, int function, char *target_ | |||
71 | /* open a stream of decompressed data */ | 67 | /* open a stream of decompressed data */ |
72 | uncompressed_file = fdopen(gz_open(deb_file, &gunzip_pid), "r"); | 68 | uncompressed_file = fdopen(gz_open(deb_file, &gunzip_pid), "r"); |
73 | 69 | ||
74 | /* get a list of all tar headers inside the .gz file */ | 70 | if (function & extract_fsys_tarfile) { |
75 | untar(uncompressed_file, function, target_dir); | 71 | copy_file_chunk(uncompressed_file, stdout, -1); |
76 | 72 | } else { | |
73 | untar(uncompressed_file, function, target_dir); | ||
74 | } | ||
77 | /* we are deliberately terminating the child so we can safely ignore this */ | 75 | /* we are deliberately terminating the child so we can safely ignore this */ |
78 | gz_close(gunzip_pid); | 76 | gz_close(gunzip_pid); |
79 | 77 | ||