mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 11:09:23 +02:00
* merged rev. 10867 to win64 and wince
git-svn-id: trunk@10868 -
This commit is contained in:
parent
577d26b290
commit
e85df2a7fb
@ -1042,7 +1042,8 @@ var
|
|||||||
p : pchar;
|
p : pchar;
|
||||||
i : longint;
|
i : longint;
|
||||||
Begin
|
Begin
|
||||||
if F.BufPos>0 then
|
while F.BufPos>0 do
|
||||||
|
begin
|
||||||
begin
|
begin
|
||||||
if F.BufPos+ErrorLen>ErrorBufferLength then
|
if F.BufPos+ErrorLen>ErrorBufferLength then
|
||||||
i:=ErrorBufferLength-ErrorLen
|
i:=ErrorBufferLength-ErrorLen
|
||||||
@ -1052,24 +1053,13 @@ Begin
|
|||||||
inc(ErrorLen,i);
|
inc(ErrorLen,i);
|
||||||
ErrorBuf[ErrorLen]:=#0;
|
ErrorBuf[ErrorLen]:=#0;
|
||||||
end;
|
end;
|
||||||
if ErrorLen>3 then
|
|
||||||
begin
|
|
||||||
p:=@ErrorBuf[ErrorLen];
|
|
||||||
for i:=1 to 4 do
|
|
||||||
begin
|
|
||||||
dec(p);
|
|
||||||
if not(p^ in [#10,#13]) then
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
if ErrorLen=ErrorBufferLength then
|
if ErrorLen=ErrorBufferLength then
|
||||||
i:=4;
|
|
||||||
if (i=4) then
|
|
||||||
begin
|
begin
|
||||||
MessageBox(0,@ErrorBuf,pchar('Error'),0);
|
MessageBox(0,@ErrorBuf,pchar('Error'),0);
|
||||||
ErrorLen:=0;
|
ErrorLen:=0;
|
||||||
end;
|
end;
|
||||||
F.BufPos:=0;
|
Dec(F.BufPos,i);
|
||||||
|
end;
|
||||||
ErrorWrite:=0;
|
ErrorWrite:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
@ -1091,6 +1081,7 @@ Begin
|
|||||||
TextRec(F).InOutFunc:=@ErrorWrite;
|
TextRec(F).InOutFunc:=@ErrorWrite;
|
||||||
TextRec(F).FlushFunc:=@ErrorWrite;
|
TextRec(F).FlushFunc:=@ErrorWrite;
|
||||||
TextRec(F).CloseFunc:=@ErrorClose;
|
TextRec(F).CloseFunc:=@ErrorClose;
|
||||||
|
ErrorLen:=0;
|
||||||
ErrorOpen:=0;
|
ErrorOpen:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
@ -1113,7 +1104,7 @@ begin
|
|||||||
if not IsConsole then
|
if not IsConsole then
|
||||||
begin
|
begin
|
||||||
AssignError(stderr);
|
AssignError(stderr);
|
||||||
AssignError(stdout);
|
AssignError(StdOut);
|
||||||
Assign(Output,'');
|
Assign(Output,'');
|
||||||
Assign(Input,'');
|
Assign(Input,'');
|
||||||
Assign(ErrOutput,'');
|
Assign(ErrOutput,'');
|
||||||
|
@ -1677,7 +1677,8 @@ var
|
|||||||
p : pchar;
|
p : pchar;
|
||||||
i : longint;
|
i : longint;
|
||||||
Begin
|
Begin
|
||||||
if F.BufPos>0 then
|
while F.BufPos>0 do
|
||||||
|
begin
|
||||||
begin
|
begin
|
||||||
if F.BufPos+ErrorLen>ErrorBufferLength then
|
if F.BufPos+ErrorLen>ErrorBufferLength then
|
||||||
i:=ErrorBufferLength-ErrorLen
|
i:=ErrorBufferLength-ErrorLen
|
||||||
@ -1687,25 +1688,14 @@ Begin
|
|||||||
inc(ErrorLen,i);
|
inc(ErrorLen,i);
|
||||||
ErrorBuf[ErrorLen]:=#0;
|
ErrorBuf[ErrorLen]:=#0;
|
||||||
end;
|
end;
|
||||||
if ErrorLen>3 then
|
|
||||||
begin
|
|
||||||
p:=@ErrorBuf[ErrorLen];
|
|
||||||
for i:=1 to 4 do
|
|
||||||
begin
|
|
||||||
dec(p);
|
|
||||||
if not(p^ in [#10,#13]) then
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
if ErrorLen=ErrorBufferLength then
|
if ErrorLen=ErrorBufferLength then
|
||||||
i:=4;
|
|
||||||
if (i=4) then
|
|
||||||
begin
|
begin
|
||||||
AnsiToWideBuf(@ErrorBuf, -1, @ErrorBufW, SizeOf(ErrorBufW));
|
AnsiToWideBuf(@ErrorBuf, -1, @ErrorBufW, SizeOf(ErrorBufW));
|
||||||
MessageBox(0,@ErrorBufW,'Error',0);
|
MessageBox(0,@ErrorBufW,'Error',0);
|
||||||
ErrorLen:=0;
|
ErrorLen:=0;
|
||||||
end;
|
end;
|
||||||
F.BufPos:=0;
|
Dec(F.BufPos,i);
|
||||||
|
end;
|
||||||
ErrorWrite:=0;
|
ErrorWrite:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
@ -1728,6 +1718,7 @@ Begin
|
|||||||
TextRec(F).InOutFunc:=@ErrorWrite;
|
TextRec(F).InOutFunc:=@ErrorWrite;
|
||||||
TextRec(F).FlushFunc:=@ErrorWrite;
|
TextRec(F).FlushFunc:=@ErrorWrite;
|
||||||
TextRec(F).CloseFunc:=@ErrorClose;
|
TextRec(F).CloseFunc:=@ErrorClose;
|
||||||
|
ErrorLen:=0;
|
||||||
ErrorOpen:=0;
|
ErrorOpen:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
@ -1746,14 +1737,16 @@ procedure SysInitStdIO;
|
|||||||
begin
|
begin
|
||||||
{ Setup stdin, stdout and stderr, for GUI apps redirect stderr,stdout to be
|
{ Setup stdin, stdout and stderr, for GUI apps redirect stderr,stdout to be
|
||||||
displayed in and messagebox }
|
displayed in and messagebox }
|
||||||
if not IsConsole then begin
|
if not IsConsole then
|
||||||
|
begin
|
||||||
AssignError(stderr);
|
AssignError(stderr);
|
||||||
AssignError(stdout);
|
AssignError(stdout);
|
||||||
Assign(Output,'');
|
Assign(Output,'');
|
||||||
Assign(Input,'');
|
Assign(Input,'');
|
||||||
Assign(ErrOutput,'');
|
Assign(ErrOutput,'');
|
||||||
end
|
end
|
||||||
else begin
|
else
|
||||||
|
begin
|
||||||
StdInputHandle:=_fileno(_getstdfilex(0));
|
StdInputHandle:=_fileno(_getstdfilex(0));
|
||||||
StdOutputHandle:=_fileno(_getstdfilex(1));
|
StdOutputHandle:=_fileno(_getstdfilex(1));
|
||||||
StdErrorHandle:=_fileno(_getstdfilex(2));
|
StdErrorHandle:=_fileno(_getstdfilex(2));
|
||||||
|
Loading…
Reference in New Issue
Block a user