mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-28 01:27:11 +01:00
* fixes to the win16 stderr output
git-svn-id: trunk@31849 -
This commit is contained in:
parent
84b47dc92c
commit
f5c2ce9058
@ -403,6 +403,11 @@ function do_isdevice(handle:THandle):boolean;
|
|||||||
var
|
var
|
||||||
regs: Registers;
|
regs: Registers;
|
||||||
begin
|
begin
|
||||||
|
if (handle=StdInputHandle) or (handle=StdOutputHandle) or (handle=StdErrorHandle) then
|
||||||
|
begin
|
||||||
|
do_isdevice:=true;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
FillChar(regs,SizeOf(regs),0);
|
FillChar(regs,SizeOf(regs),0);
|
||||||
regs.AX := $4400;
|
regs.AX := $4400;
|
||||||
regs.BX := handle;
|
regs.BX := handle;
|
||||||
|
|||||||
@ -298,7 +298,7 @@ Begin
|
|||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
procedure ErrorClose(Var F: TextRec);
|
procedure ShowErrMsg;
|
||||||
begin
|
begin
|
||||||
if ErrorLen>0 then
|
if ErrorLen>0 then
|
||||||
begin
|
begin
|
||||||
@ -312,8 +312,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure ErrorClose(Var F: TextRec);
|
||||||
|
begin
|
||||||
|
ShowErrMsg;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure ErrorOpen(Var F: TextRec);
|
procedure ErrorOpen(Var F: TextRec);
|
||||||
Begin
|
Begin
|
||||||
|
TextRec(F).Handle:=StdErrorHandle;
|
||||||
|
TextRec(F).Mode:=fmOutput;
|
||||||
TextRec(F).InOutFunc:=@ErrorWrite;
|
TextRec(F).InOutFunc:=@ErrorWrite;
|
||||||
TextRec(F).FlushFunc:=@ErrorWrite;
|
TextRec(F).FlushFunc:=@ErrorWrite;
|
||||||
TextRec(F).CloseFunc:=@ErrorClose;
|
TextRec(F).CloseFunc:=@ErrorClose;
|
||||||
@ -355,6 +363,7 @@ begin
|
|||||||
Close(erroutput);
|
Close(erroutput);
|
||||||
Close(Input);
|
Close(Input);
|
||||||
Close(Output);
|
Close(Output);
|
||||||
|
ShowErrMsg;
|
||||||
asm
|
asm
|
||||||
mov al, byte [exitcode]
|
mov al, byte [exitcode]
|
||||||
mov ah, 4Ch
|
mov ah, 4Ch
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user