diff options
author | Denys Vlasenko | 2018-02-01 09:13:14 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-02-01 09:13:14 +0100 |
commit | d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6 (patch) | |
tree | 24b4adf0a28b91dbcd014cf99527ca07d492003d /archival/bzip2.c | |
parent | 99ac1759dd429bd7995feff33dc683589c016c8e (diff) | |
download | busybox-d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6.zip busybox-d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6.tar.gz |
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 c3969a9..fa90615 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 iobuf = xmalloc(2 * IOBUF_SIZE); - opt = option_mask32 >> (sizeof("cfkvq" IF_FEATURE_BZIP2_DECOMPRESS("dt") "zs") - 1); + opt = option_mask32 >> (BBUNPK_OPTSTRLEN IF_FEATURE_BZIP2_DECOMPRESS(+ 2) + 2); + /* skipped BBUNPK_OPTSTR, "dt" and "zs" bits */ opt |= 0x100; /* if nothing else, assume -9 */ level = 0; for (;;) { @@ -205,17 +206,17 @@ int bzip2_main(int argc UNUSED_PARAM, char **argv) */ opt = getopt32(argv, "^" - /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */ - "cfkvq" IF_FEATURE_BZIP2_DECOMPRESS("dt") "zs123456789" + /* Must match BBUNPK_foo constants! */ + BBUNPK_OPTSTR IF_FEATURE_BZIP2_DECOMPRESS("dt") "zs123456789" "\0" "s2" /* -s means -2 (compatibility) */ ); #if ENABLE_FEATURE_BZIP2_DECOMPRESS /* bunzip2_main may not be visible... */ - if (opt & (3 << 5)) /* -d and/or -t */ + if (opt & (BBUNPK_OPT_DECOMPRESS|BBUNPK_OPT_TEST)) /* -d and/or -t */ return bunzip2_main(argc, argv); #else /* clear "decompress" and "test" bits (or bbunpack() can get confused) */ /* in !BZIP2_DECOMPRESS config, these bits are -zs and are unused */ - option_mask32 = opt & ~(3 << 5); + option_mask32 = opt & ~(BBUNPK_OPT_DECOMPRESS|BBUNPK_OPT_TEST); #endif argv += optind; |