Skip to content

Commit

Permalink
Fix #101 - thanks to aeonios for pointing that out
Browse files Browse the repository at this point in the history
Begin with #97
  • Loading branch information
mcmilk committed Dec 22, 2019
1 parent a95e994 commit c2277a3
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 99 deletions.
14 changes: 13 additions & 1 deletion CPP/7zip/UI/Common/CompressCall.cpp
Expand Up @@ -229,22 +229,34 @@ HRESULT CompressFiles(
index = FindRegistryFormatAlways(arcType);
if (index >= 0)
{
char temp[32];
char temp[256];
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];

if (!fo.Method.IsEmpty())
{
params += " -m0=";
params += fo.Method;
}

if (fo.Level)
{
params += " -mx=";
ConvertUInt64ToString(fo.Level, temp);
params += temp;
}

if (fo.NumThreads)
{
params += " -mmt=";
ConvertUInt64ToString(fo.NumThreads, temp);
params += temp;
}

if (!fo.Options.IsEmpty())
{
params += " -m";
params += fo.Options;
}
}
}
// for testing current params, /TR 2017-05-18
Expand Down
5 changes: 4 additions & 1 deletion CPP/7zip/UI/Common/ZipRegistry.cpp
Expand Up @@ -160,6 +160,7 @@ static LPCTSTR const kBlockSize = TEXT("BlockSize");
static LPCTSTR const kNumThreads = TEXT("NumThreads");
static LPCWSTR const kMethod = L"Method";
static LPCWSTR const kOptions = L"Options";
static LPCWSTR const kSplitVolume = L"SplitVolume";
static LPCWSTR const kEncryptionMethod = L"EncryptionMethod";

static LPCTSTR const kNtSecur = TEXT("Security");
Expand Down Expand Up @@ -233,6 +234,7 @@ void CInfo::Save() const

SetRegString(fk, kMethod, fo.Method);
SetRegString(fk, kOptions, fo.Options);
SetRegString(fk, kSplitVolume, fo.SplitVolume);
SetRegString(fk, kEncryptionMethod, fo.EncryptionMethod);
}
}
Expand Down Expand Up @@ -274,8 +276,9 @@ void CInfo::Load()
fo.FormatID = formatIDs[i];
if (fk.Open(optionsKey, fo.FormatID, KEY_READ) == ERROR_SUCCESS)
{
GetRegString(fk, kOptions, fo.Options);
GetRegString(fk, kMethod, fo.Method);
GetRegString(fk, kOptions, fo.Options);
GetRegString(fk, kSplitVolume, fo.SplitVolume);
GetRegString(fk, kEncryptionMethod, fo.EncryptionMethod);

GetRegUInt32(fk, kLevel, fo.Level);
Expand Down
1 change: 1 addition & 0 deletions CPP/7zip/UI/Common/ZipRegistry.h
Expand Up @@ -45,6 +45,7 @@ namespace NCompression

CSysString FormatID;
UString Method;
UString SplitVolume;
UString Options;
UString EncryptionMethod;

Expand Down

0 comments on commit c2277a3

Please sign in to comment.