diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-01 09:13:14 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-01 09:13:14 +0100 |
commit | d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6 (patch) | |
tree | 24b4adf0a28b91dbcd014cf99527ca07d492003d /archival/bzip2.c | |
parent | 99ac1759dd429bd7995feff33dc683589c016c8e (diff) | |
download | busybox-w32-d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6.tar.gz busybox-w32-d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6.tar.bz2 busybox-w32-d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6.zip |
libarchive: move bbunpack constants to bb_archive.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/bzip2.c')
-rw-r--r-- | archival/bzip2.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/archival/bzip2.c b/archival/bzip2.c index c3969a9e8..fa906150f 100644 --- a/archival/bzip2.c +++ b/archival/bzip2.c | |||
@@ -151,7 +151,8 @@ IF_DESKTOP(long long) int FAST_FUNC compressStream(transformer_state_t *xstate U | |||
151 | 151 | ||
152 | iobuf = xmalloc(2 * IOBUF_SIZE); | 152 | iobuf = xmalloc(2 * IOBUF_SIZE); |
153 | 153 | ||
154 | opt = option_mask32 >> (sizeof("cfkvq" IF_FEATURE_BZIP2_DECOMPRESS("dt") "zs") - 1); | 154 | opt = option_mask32 >> (BBUNPK_OPTSTRLEN IF_FEATURE_BZIP2_DECOMPRESS(+ 2) + 2); |
155 | /* skipped BBUNPK_OPTSTR, "dt" and "zs" bits */ | ||
155 | opt |= 0x100; /* if nothing else, assume -9 */ | 156 | opt |= 0x100; /* if nothing else, assume -9 */ |
156 | level = 0; | 157 | level = 0; |
157 | for (;;) { | 158 | for (;;) { |
@@ -205,17 +206,17 @@ int bzip2_main(int argc UNUSED_PARAM, char **argv) | |||
205 | */ | 206 | */ |
206 | 207 | ||
207 | opt = getopt32(argv, "^" | 208 | opt = getopt32(argv, "^" |
208 | /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */ | 209 | /* Must match BBUNPK_foo constants! */ |
209 | "cfkvq" IF_FEATURE_BZIP2_DECOMPRESS("dt") "zs123456789" | 210 | BBUNPK_OPTSTR IF_FEATURE_BZIP2_DECOMPRESS("dt") "zs123456789" |
210 | "\0" "s2" /* -s means -2 (compatibility) */ | 211 | "\0" "s2" /* -s means -2 (compatibility) */ |
211 | ); | 212 | ); |
212 | #if ENABLE_FEATURE_BZIP2_DECOMPRESS /* bunzip2_main may not be visible... */ | 213 | #if ENABLE_FEATURE_BZIP2_DECOMPRESS /* bunzip2_main may not be visible... */ |
213 | if (opt & (3 << 5)) /* -d and/or -t */ | 214 | if (opt & (BBUNPK_OPT_DECOMPRESS|BBUNPK_OPT_TEST)) /* -d and/or -t */ |
214 | return bunzip2_main(argc, argv); | 215 | return bunzip2_main(argc, argv); |
215 | #else | 216 | #else |
216 | /* clear "decompress" and "test" bits (or bbunpack() can get confused) */ | 217 | /* clear "decompress" and "test" bits (or bbunpack() can get confused) */ |
217 | /* in !BZIP2_DECOMPRESS config, these bits are -zs and are unused */ | 218 | /* in !BZIP2_DECOMPRESS config, these bits are -zs and are unused */ |
218 | option_mask32 = opt & ~(3 << 5); | 219 | option_mask32 = opt & ~(BBUNPK_OPT_DECOMPRESS|BBUNPK_OPT_TEST); |
219 | #endif | 220 | #endif |
220 | 221 | ||
221 | argv += optind; | 222 | argv += optind; |