FIX: Zip - When reading archives replace relative paths by underlines

(cherry picked from commit 344b0b786b)
This commit is contained in:
Alexander Koblov 2025-11-02 13:34:57 +03:00
commit 3f2fcb350a

View file

@ -174,6 +174,17 @@ begin
DoDirSeparators(Result);
Result := ExcludeFrontPathDelimiter(Result);
Result := ExcludeTrailingPathDelimiter(Result);
while StrBegins(Result, '..' + PathDelim) do
begin
Result := Copy(Result, 4, MaxInt);
Result := ExcludeFrontPathDelimiter(Result);
end;
if StrEnds(Result, PathDelim + '..') then
begin
Result[Length(Result)] := '_';
Result[Length(Result) - 1] := '_';
end;
Result := StringReplace(Result, PathDelim + '..' + PathDelim, PathDelim + '__' + PathDelim, [rfReplaceAll]);
end;
procedure TAbZipKit.DeleteDirectoriesRecursively(const Paths: String);