mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:49:19 +02:00
* fixed writing of long strings when using the crt unit on win32, resolves #8843
git-svn-id: trunk@10449 -
This commit is contained in:
parent
5ffdd04040
commit
ff03c9569d
@ -645,19 +645,29 @@ var
|
|||||||
WinAttr : word;
|
WinAttr : word;
|
||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
WritePos.X := currX - 1;
|
WritePos.X:=currX-2;
|
||||||
WritePos.Y := currY - 1;
|
WritePos.Y:=currY-1;
|
||||||
|
|
||||||
WriteConsoleOutputCharacter(GetStdhandle(STD_OUTPUT_HANDLE), @s[1], Length(s), writePos, numWritten);
|
|
||||||
|
|
||||||
WinAttr:=TextAttr;
|
WinAttr:=TextAttr;
|
||||||
dec(WritePos.X);
|
for i:=1 to Length(s) do
|
||||||
for i:=0 to Length(s)-1 do
|
|
||||||
begin
|
begin
|
||||||
inc(WritePos.X);
|
Inc(WritePos.X);
|
||||||
|
WriteConsoleOutputCharacter(GetStdhandle(STD_OUTPUT_HANDLE), @s[i], 1, writePos, numWritten);
|
||||||
WriteConsoleOutputAttribute(GetStdhandle(STD_OUTPUT_HANDLE),@WinAttr, 1, writePos, numWritten);
|
WriteConsoleOutputAttribute(GetStdhandle(STD_OUTPUT_HANDLE),@WinAttr, 1, writePos, numWritten);
|
||||||
|
Inc(CurrX);
|
||||||
|
if CurrX>WindMaxX then
|
||||||
|
begin
|
||||||
|
CurrX:=WindMinX;
|
||||||
|
Inc(CurrY);
|
||||||
|
While CurrY>WindMaxY do
|
||||||
|
begin
|
||||||
|
RemoveLine(1);
|
||||||
|
Dec(CurrY);
|
||||||
|
end;
|
||||||
|
WritePos.X:=currX-2;
|
||||||
|
WritePos.Y:=currY-1;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
Inc(CurrX,Length(s));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -678,7 +688,7 @@ begin
|
|||||||
if s<>'' then
|
if s<>'' then
|
||||||
begin
|
begin
|
||||||
WriteStr(s);
|
WriteStr(s);
|
||||||
s:='';
|
s:='';
|
||||||
end;
|
end;
|
||||||
WriteChar(f.buffer[i]);
|
WriteChar(f.buffer[i]);
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user