mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
UPD: Raise EReadError exception when can not read from TFileStreamEx
FIX: Bug [0000923] "Uncorrect work of build in zip.wcx plugin"
This commit is contained in:
parent
cc28b66bee
commit
427b77907a
3 changed files with 21 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ type
|
|||
function ReadQWord: QWord;
|
||||
procedure WriteQWord(q: QWord);
|
||||
{$ENDIF}
|
||||
function Read(var Buffer; Count: LongInt): LongInt; override;
|
||||
property FileName: UTF8String read FFileName;
|
||||
end;
|
||||
|
||||
|
|
@ -122,6 +123,13 @@ begin
|
|||
if FHandle >= 0 then FileClose(FHandle);
|
||||
end;
|
||||
|
||||
function TFileStreamEx.Read(var Buffer; Count: LongInt): LongInt;
|
||||
begin
|
||||
Result:= FileRead(FHandle, Buffer, Count);
|
||||
if Result = -1 then
|
||||
raise EReadError.Create(mbSysErrorMessage(GetLastOSError));
|
||||
end;
|
||||
|
||||
{$IF (FPC_VERSION <= 2) and (FPC_RELEASE <= 4) and (FPC_PATCH <= 0)}
|
||||
function TFileStreamEx.ReadQWord: QWord;
|
||||
var
|
||||
|
|
|
|||
|
|
@ -889,6 +889,7 @@ begin
|
|||
{$ENDIF}
|
||||
raise EAbDeflateError.Create(E.Message);
|
||||
end;
|
||||
else raise;
|
||||
end;
|
||||
finally
|
||||
Helper.Free;
|
||||
|
|
|
|||
|
|
@ -671,6 +671,18 @@ Index: AbBzip2Typ.pas
|
|||
try
|
||||
CompStream.CopyFrom(InputFileStream, 0);{ Copy/compress entire Instream to FBzip2Stream }
|
||||
finally
|
||||
Index: AbDfEnc.pas
|
||||
===================================================================
|
||||
--- AbDfEnc.pas (revision 512)
|
||||
+++ AbDfEnc.pas (working copy)
|
||||
@@ -889,6 +889,7 @@
|
||||
{$ENDIF}
|
||||
raise EAbDeflateError.Create(E.Message);
|
||||
end;
|
||||
+ else raise;
|
||||
end;
|
||||
finally
|
||||
Helper.Free;
|
||||
Index: AbDfInW.pas
|
||||
===================================================================
|
||||
--- AbDfInW.pas (revision 512)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue