From 221bcaf93ae5590e9c41e0d6e937365085680641 Mon Sep 17 00:00:00 2001 From: dinhngtu <1257909+dinhngtu@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:23:30 +0100 Subject: [PATCH] Don't pass common compression props to handlers. (#368) --- .../CPP/7zip/Archive/Common/HandlerOut.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/NanaZip.Core/SevenZip/CPP/7zip/Archive/Common/HandlerOut.cpp b/NanaZip.Core/SevenZip/CPP/7zip/Archive/Common/HandlerOut.cpp index 0b0060e97..f1ccfd2c3 100644 --- a/NanaZip.Core/SevenZip/CPP/7zip/Archive/Common/HandlerOut.cpp +++ b/NanaZip.Core/SevenZip/CPP/7zip/Archive/Common/HandlerOut.cpp @@ -203,13 +203,18 @@ HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIAN { HRESULT hres; - // **************** 7-Zip ZS Modification Start **************** - /*if (SetCommonProperty(name, value, hres)) - return hres;*/ - SetCommonProperty(name, value, hres); - /* don't return here, since many handlers set common properties (e. g. kNumThreads) - with SetCoderProperties, so add it also as prop by its ID from name below */ - // **************** 7-Zip ZS Modification End **************** + // **************** NanaZip Modification Start **************** + if (SetCommonProperty(name, value, hres)) + { + if (name.IsPrefixedBy_Ascii_NoCase("mt")) + { + // pass through kNumThreads to handler + } + else { + return hres; + } + } + // **************** NanaZip Modification End **************** } UInt32 number;