]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
--ultra automatically triggered with --long and --patch-from 4289/head
authorYann Collet <cyan@fb.com>
Sun, 9 Feb 2025 06:47:05 +0000 (22:47 -0800)
committerYann Collet <cyan@fb.com>
Sun, 9 Feb 2025 06:47:05 +0000 (22:47 -0800)
the purpose of --ultra is to make the user explicitly opt-in
to generate very large window size (> 8 MB).

The agreement to generate very large window size is already implicit
when selecting --long or --patch-from.

Consequently, `--ultra ` is automatically enabled when `--long` or `--patch-from` is set.

programs/zstdcli.c

index 7d00a94b2fcf2f36bd5cde5e0e86f635ea0d2cd9..8569896c0996092ce4072f532f28f46f3bc280ce 100644 (file)
@@ -1082,10 +1082,11 @@ int main(int argCount, const char* argv[])
 #ifndef ZSTD_NOTRACE
                 if (longCommandWArg(&argument, "--trace")) { char const* traceFile; NEXT_FIELD(traceFile); TRACE_enable(traceFile); continue; }
 #endif
-                if (longCommandWArg(&argument, "--patch-from")) { NEXT_FIELD(patchFromDictFileName); continue; }
+                if (longCommandWArg(&argument, "--patch-from")) { NEXT_FIELD(patchFromDictFileName); ultra = 1; continue; }
                 if (longCommandWArg(&argument, "--long")) {
                     unsigned ldmWindowLog = 0;
                     ldmFlag = 1;
+                    ultra = 1;
                     /* Parse optional window log */
                     if (*argument == '=') {
                         ++argument;