]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xz: Do not set compression settings with raw format in list mode.
authorJia Tan <jiat0218@gmail.com>
Mon, 16 Jan 2023 12:55:10 +0000 (20:55 +0800)
committerJia Tan <jiat0218@gmail.com>
Fri, 3 Feb 2023 13:11:11 +0000 (21:11 +0800)
Calling coder_set_compression_settings() in list mode with verbose mode
on caused the filter chain and memory requirements to print. This was
unnecessary since the command results in an error and not consistent
with other formats like lzma and alone.

src/xz/args.c

index b0a1174a25bdc7a5349be35249ce50878f1577ed..c31f759a0a6c166b469ae5e5d7e747101b9f030d 100644 (file)
@@ -720,7 +720,8 @@ args_parse(args_info *args, int argc, char **argv)
        // be done also when uncompressing raw data, since for raw decoding
        // the options given on the command line are used to know what kind
        // of raw data we are supposed to decode.
-       if (opt_mode == MODE_COMPRESS || opt_format == FORMAT_RAW)
+       if (opt_mode == MODE_COMPRESS || (opt_format == FORMAT_RAW
+                       && opt_mode != MODE_LIST))
                coder_set_compression_settings();
 
        // If no filenames are given, use stdin.