From c6199980f02823120d2c46eb93cabe2c177e4c5c Mon Sep 17 00:00:00 2001 From: ckolivas Date: Tue, 1 Mar 2011 17:25:50 +1100 Subject: [PATCH] Disable file checking when not possible or meaningful. --- main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 2ffd6f9..accdd9e 100644 --- a/main.c +++ b/main.c @@ -977,12 +977,9 @@ int main(int argc, char *argv[]) if (UNLIMITED && STDIN) { print_err("Cannot have -U and stdin, unlimited mode disabled.\n"); - control.flags &= ~ FLAG_UNLIMITED; + control.flags &= ~FLAG_UNLIMITED; } - if (CHECK_FILE && (!DECOMPRESS || !TEST_ONLY)) - print_err("Can only check file written on decompression or testing.\n"); - /* Work out the compression overhead per compression thread for the * compression back-ends that need a lot of ram */ if (LZMA_COMPRESS) { @@ -1049,6 +1046,16 @@ int main(int argc, char *argv[]) } } + if (CHECK_FILE) { + if (!DECOMPRESS) { + print_err("Can only check file written on decompression.\n"); + control.flags &= ~FLAG_CHECK; + } else if (STDOUT) { + print_err("Can't check file written when writing to stdout. Checking disabled.\n"); + control.flags &= ~FLAG_CHECK; + } + } + show_summary(); gettimeofday(&start_time, NULL);