Fix exception in ReadTextfileChunk when file has 0 bytes.

This commit is contained in:
Ansgar Becker
2013-09-28 09:56:44 +00:00
parent dd20574b3c
commit e3da264b08

View File

@ -1390,6 +1390,11 @@ var
i: Integer;
begin
// Read a chunk or the complete contents out of a textfile, opened by OpenTextFile()
if Stream.Size = 0 then begin
Result := '';
Exit;
end;
StartPosition := Stream.Position;
DataLeft := Stream.Size - Stream.Position;
if (ChunkSize = 0) or (ChunkSize > DataLeft) then