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:
Alexander Koblov 2014-09-26 19:02:31 +00:00
commit 427b77907a
3 changed files with 21 additions and 0 deletions

View file

@ -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

View file

@ -889,6 +889,7 @@ begin
{$ENDIF}
raise EAbDeflateError.Create(E.Message);
end;
else raise;
end;
finally
Helper.Free;

View file

@ -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)