mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: TXzDecompressionStream.Seek function
This commit is contained in:
parent
a7f80e5fd1
commit
d8bc7ce213
1 changed files with 6 additions and 3 deletions
|
|
@ -344,9 +344,12 @@ end;
|
|||
|
||||
function TXzDecompressionStream.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64;
|
||||
begin
|
||||
if (Offset = 0) and (Origin = soCurrent) then
|
||||
Result:= FLzmaRec.total_in
|
||||
else if (Origin = soBeginning) and (FLzmaRec.total_in = Offset) then
|
||||
if (Offset >= 0) and (Origin = soCurrent) then
|
||||
begin
|
||||
if (Offset > 0) then Discard(Offset);
|
||||
Result:= FLzmaRec.total_out;
|
||||
end
|
||||
else if (Origin = soBeginning) and (FLzmaRec.total_out = Offset) then
|
||||
Result:= Offset
|
||||
else begin
|
||||
raise ELzmaDecompressionError.CreateFmt(SStreamInvalidSeek, [ClassName]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue