* merged rev. 10867 to win64 and wince

git-svn-id: trunk@10868 -
This commit is contained in:
florian 2008-05-02 18:54:16 +00:00
parent 577d26b290
commit e85df2a7fb
2 changed files with 55 additions and 71 deletions

View File

@ -1042,7 +1042,8 @@ var
p : pchar;
i : longint;
Begin
if F.BufPos>0 then
while F.BufPos>0 do
begin
begin
if F.BufPos+ErrorLen>ErrorBufferLength then
i:=ErrorBufferLength-ErrorLen
@ -1052,24 +1053,13 @@ Begin
inc(ErrorLen,i);
ErrorBuf[ErrorLen]:=#0;
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
i:=4;
if (i=4) then
begin
MessageBox(0,@ErrorBuf,pchar('Error'),0);
ErrorLen:=0;
end;
F.BufPos:=0;
Dec(F.BufPos,i);
end;
ErrorWrite:=0;
End;
@ -1091,6 +1081,7 @@ Begin
TextRec(F).InOutFunc:=@ErrorWrite;
TextRec(F).FlushFunc:=@ErrorWrite;
TextRec(F).CloseFunc:=@ErrorClose;
ErrorLen:=0;
ErrorOpen:=0;
End;
@ -1113,7 +1104,7 @@ begin
if not IsConsole then
begin
AssignError(stderr);
AssignError(stdout);
AssignError(StdOut);
Assign(Output,'');
Assign(Input,'');
Assign(ErrOutput,'');

View File

@ -1677,7 +1677,8 @@ var
p : pchar;
i : longint;
Begin
if F.BufPos>0 then
while F.BufPos>0 do
begin
begin
if F.BufPos+ErrorLen>ErrorBufferLength then
i:=ErrorBufferLength-ErrorLen
@ -1687,25 +1688,14 @@ Begin
inc(ErrorLen,i);
ErrorBuf[ErrorLen]:=#0;
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
i:=4;
if (i=4) then
begin
AnsiToWideBuf(@ErrorBuf, -1, @ErrorBufW, SizeOf(ErrorBufW));
MessageBox(0,@ErrorBufW,'Error',0);
ErrorLen:=0;
end;
F.BufPos:=0;
Dec(F.BufPos,i);
end;
ErrorWrite:=0;
End;
@ -1728,6 +1718,7 @@ Begin
TextRec(F).InOutFunc:=@ErrorWrite;
TextRec(F).FlushFunc:=@ErrorWrite;
TextRec(F).CloseFunc:=@ErrorClose;
ErrorLen:=0;
ErrorOpen:=0;
End;
@ -1746,14 +1737,16 @@ procedure SysInitStdIO;
begin
{ Setup stdin, stdout and stderr, for GUI apps redirect stderr,stdout to be
displayed in and messagebox }
if not IsConsole then begin
if not IsConsole then
begin
AssignError(stderr);
AssignError(stdout);
Assign(Output,'');
Assign(Input,'');
Assign(ErrOutput,'');
end
else begin
else
begin
StdInputHandle:=_fileno(_getstdfilex(0));
StdOutputHandle:=_fileno(_getstdfilex(1));
StdErrorHandle:=_fileno(_getstdfilex(2));