Disable file checking when not possible or meaningful.

This commit is contained in:
ckolivas 2011-03-01 17:25:50 +11:00 committed by Con Kolivas
parent 10b1201f82
commit c6199980f0

15
main.c
View file

@ -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);