From d6f0f03b68fc4cf9ffb8006e192e36f0ebf51ea6 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 1 Feb 2018 09:13:14 +0100 Subject: libarchive: move bbunpack constants to bb_archive.h Signed-off-by: Denys Vlasenko --- archival/bzip2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'archival/bzip2.c') 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; -- cgit v1.1