mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Zip - remove a partial archive on cancel (fixes #1260)
(cherry picked from commit f2eb7513c8)
This commit is contained in:
parent
1975616ccf
commit
f9454e6fe9
1 changed files with 6 additions and 0 deletions
|
|
@ -389,6 +389,7 @@ end;
|
|||
|
||||
function PackFilesW(PackedFile: PWideChar; SubPath: PWideChar; SrcPath: PWideChar; AddList: PWideChar; Flags: Integer): Integer;dcpcall; export;
|
||||
var
|
||||
Exists: Boolean;
|
||||
FileExt: String;
|
||||
FilePath: String;
|
||||
Arc : TAbZipKitEx;
|
||||
|
|
@ -412,6 +413,7 @@ begin
|
|||
sPackedFile := UTF16ToUTF8(UnicodeString(PackedFile));
|
||||
|
||||
try
|
||||
Exists:= mbFileExists(sPackedFile);
|
||||
FileExt:= LowerCase(ExtractFileExt(sPackedFile));
|
||||
|
||||
if ((Flags and PK_PACK_ENCRYPT) <> 0) then
|
||||
|
|
@ -490,6 +492,10 @@ begin
|
|||
Result := Arc.FOperationResult;
|
||||
FreeAndNil(Arc);
|
||||
end;
|
||||
if (Result = E_EABORTED) and (not Exists) then
|
||||
begin
|
||||
mbDeleteFile(sPackedFile);
|
||||
end;
|
||||
end;
|
||||
|
||||
function DeleteFilesW(PackedFile, DeleteList : PWideChar) : Integer;dcpcall; export;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue