mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 14:49:17 +02:00
* merged copyfrom with 0
This commit is contained in:
parent
47ef7617f5
commit
9d55df2bd5
@ -158,18 +158,22 @@
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
CopyFrom:=0;
|
CopyFrom:=0;
|
||||||
|
If (Count=0) then
|
||||||
|
begin
|
||||||
|
// This WILL fail for non-seekable streams...
|
||||||
|
Source.Position:=0;
|
||||||
|
Count:=Source.Size;
|
||||||
|
end;
|
||||||
while Count>0 do
|
while Count>0 do
|
||||||
begin
|
begin
|
||||||
if (Count>sizeof(buffer)) then
|
if (Count>sizeof(buffer)) then
|
||||||
i:=sizeof(Buffer)
|
i:=sizeof(Buffer)
|
||||||
else
|
else
|
||||||
i:=Count;
|
i:=Count;
|
||||||
i:=Source.Read(buffer,i);
|
i:=Source.Read(buffer,i);
|
||||||
i:=Write(buffer,i);
|
i:=Write(buffer,i);
|
||||||
dec(count,i);
|
dec(count,i);
|
||||||
CopyFrom:=CopyFrom+i;
|
CopyFrom:=CopyFrom+i;
|
||||||
if i=0 then
|
|
||||||
exit;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -783,8 +787,14 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2003-10-06 21:01:06 peter
|
Revision 1.2 2003-10-30 16:30:53 peter
|
||||||
* moved classes unit to rtl
|
* merged copyfrom with 0
|
||||||
|
|
||||||
|
Revision 1.3 2003/10/28 22:04:29 michael
|
||||||
|
+ Fixed private seeksupport stuff
|
||||||
|
|
||||||
|
Revision 1.2 2003/10/26 14:52:29 michael
|
||||||
|
+ Fixed TStream.CopyFrom with Count=0
|
||||||
|
|
||||||
Revision 1.13 2003/07/26 16:20:50 michael
|
Revision 1.13 2003/07/26 16:20:50 michael
|
||||||
+ Fixed readstring from TStringStream (
|
+ Fixed readstring from TStringStream (
|
||||||
|
Loading…
Reference in New Issue
Block a user