From 29c099fe567f9396cbf30f9298fe3c8657097d8b Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 22 Nov 2006 19:29:07 +0100 Subject: [PATCH] Disallow --exact with --overlay=strip. --- src/main.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8d0619ca..ab944301 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -237,12 +237,24 @@ void check_options(int i, int argc) { assert(i <= argc); + if (opt->cmd != CMD_COMPRESS) + { + // invalidate compression options + opt->method = 0; + opt->level = 0; + opt->exact = 0; + opt->small = 0; + opt->crp.reset(); + } + // set default overlay action if (!(opt->cmd == CMD_COMPRESS || opt->cmd == CMD_DECOMPRESS)) opt->overlay = opt->COPY_OVERLAY; else if (opt->overlay < 0) opt->overlay = opt->COPY_OVERLAY; + check_not_both(opt->exact, opt->overlay == opt->STRIP_OVERLAY, "--exact", "--overlay=strip"); + // set default backup option if (opt->backup < 0) opt->backup = 0; @@ -1421,16 +1433,6 @@ int __acc_cdecl_main main(int argc, char *argv[]) break; } - if (opt->cmd != CMD_COMPRESS) - { - // invalidate compression options - opt->method = 0; - opt->level = 0; - opt->exact = 0; - opt->small = 0; - opt->crp.reset(); - } - /* check options */ if (argc == 1) e_help();