src: cleanup option handling, add testcases; fixes #587

This commit is contained in:
Markus F.X.J. Oberhumer
2022-09-11 15:58:37 +02:00
parent 575cb720c6
commit 4318cc22ee
8 changed files with 175 additions and 103 deletions
+4 -3
View File
@@ -63,9 +63,10 @@ const int *PackExe::getCompressionMethods(int method, int level) const
{
bool small = ih_imagesize <= 256*1024;
// disable lzma for "--brute" unless explicitly given "--lzma"
// WARNING: this side effect persists for later files!
if (opt->all_methods_use_lzma && !opt->method_lzma_seen)
opt->all_methods_use_lzma = false;
// WARNING: this side effect may persists for later files;
// but note that class PackMaster creates per-file local options
if (opt->all_methods_use_lzma == 1 && !opt->method_lzma_seen)
opt->all_methods_use_lzma = 0;
return Packer::getDefaultCompressionMethods_8(method, level, small);
}