diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-02-02 02:06:38 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-02-02 02:06:38 +0100 |
commit | 640ce3de07807133796bccd0bdfa146bbfc788c7 (patch) | |
tree | 0d17e53405b8cbf71aed4d8ba6c9dc27df14814a /archival/bbunzip.c | |
parent | f1999b5a9d2788cdc120b1ee2ab1de18e95b38f2 (diff) | |
download | busybox-w32-640ce3de07807133796bccd0bdfa146bbfc788c7.tar.gz busybox-w32-640ce3de07807133796bccd0bdfa146bbfc788c7.tar.bz2 busybox-w32-640ce3de07807133796bccd0bdfa146bbfc788c7.zip |
zcat: complain if input is not compressed
function old new delta
buffer_fill_and_print 178 191 +13
varvalue 735 743 +8
bbunpack 747 755 +8
open_zipped 85 89 +4
xmalloc_open_zipped_read_close 61 63 +2
get_addr_1 240 242 +2
fbsplash_main 1228 1230 +2
pstree_main 322 321 -1
builtin_type 121 119 -2
do_load 954 926 -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 7/3 up/down: 39/-31) Total: 8 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/bbunzip.c')
-rw-r--r-- | archival/bbunzip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c index b3fb90f31..fce5ab9e1 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c | |||
@@ -72,7 +72,8 @@ int FAST_FUNC bbunpack(char **argv, | |||
72 | goto err; | 72 | goto err; |
73 | } else { | 73 | } else { |
74 | /* "clever zcat" with FILE */ | 74 | /* "clever zcat" with FILE */ |
75 | int fd = open_zipped(filename); | 75 | /* fail_if_not_compressed because zcat refuses uncompressed input */ |
76 | int fd = open_zipped(filename, /*fail_if_not_compressed:*/ 1); | ||
76 | if (fd < 0) | 77 | if (fd < 0) |
77 | goto err_name; | 78 | goto err_name; |
78 | xmove_fd(fd, STDIN_FILENO); | 79 | xmove_fd(fd, STDIN_FILENO); |
@@ -80,7 +81,7 @@ int FAST_FUNC bbunpack(char **argv, | |||
80 | } else | 81 | } else |
81 | if (option_mask32 & SEAMLESS_MAGIC) { | 82 | if (option_mask32 & SEAMLESS_MAGIC) { |
82 | /* "clever zcat" on stdin */ | 83 | /* "clever zcat" on stdin */ |
83 | if (setup_unzip_on_fd(STDIN_FILENO, /*fail_if_not_detected*/ 0)) | 84 | if (setup_unzip_on_fd(STDIN_FILENO, /*fail_if_not_compressed*/ 1)) |
84 | goto err; | 85 | goto err; |
85 | } | 86 | } |
86 | 87 | ||