Skip to content

Commit d994c0c

Browse files
committed
fixes gh-401: zip compression without dialog follows the last settings stored in dialog
1 parent 936624e commit d994c0c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

CPP/7zip/UI/Common/CompressCall.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ HRESULT CompressFiles(
217217
params += kIncludeSwitch;
218218
RINOK(CreateMap(names, fileMapping, event, params))
219219

220-
if (!arcType.IsEmpty() && arcType == L"7z")
220+
if (!arcType.IsEmpty() && ((arcType == L"7z") || (arcType == L"zip")))
221221
{
222222
int index;
223223
params += kArchiveTypeSwitch;
@@ -231,7 +231,7 @@ HRESULT CompressFiles(
231231

232232
if (!fo.Method.IsEmpty())
233233
{
234-
params += " -m0=";
234+
params += (arcType == L"7z") ? " -m0=" : " -mm=";
235235
params += fo.Method;
236236
}
237237

@@ -242,23 +242,23 @@ HRESULT CompressFiles(
242242
params += temp;
243243
}
244244

245-
if (fo.Dictionary)
245+
if (fo.Dictionary && (arcType == L"7z"))
246246
{
247247
params += " -md=";
248248
ConvertUInt32ToString(fo.Dictionary, temp);
249249
params += temp;
250250
params += "b";
251251
}
252252

253-
if (fo.BlockLogSize)
253+
if (fo.BlockLogSize && (arcType == L"7z"))
254254
{
255255
params += " -ms=";
256256
ConvertUInt64ToString(1ULL << fo.BlockLogSize, temp);
257257
params += temp;
258258
params += "b";
259259
}
260260

261-
if (fo.NumThreads)
261+
if (fo.NumThreads && fo.NumThreads != -1)
262262
{
263263
params += " -mmt=";
264264
ConvertUInt32ToString(fo.NumThreads, temp);

0 commit comments

Comments
 (0)