mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-01 17:47:16 +01:00
* fix isatty return value checks
git-svn-id: trunk@1292 -
This commit is contained in:
parent
c3a5f88a7b
commit
9ea69cfec9
@ -1265,7 +1265,7 @@ var
|
||||
c : char;
|
||||
i : longint;
|
||||
Begin
|
||||
if isATTY(F.Handle)<>-1 then
|
||||
if isATTY(F.Handle)=1 then
|
||||
begin
|
||||
F.BufPos := 0;
|
||||
i := 0;
|
||||
@ -1574,10 +1574,10 @@ Initialization
|
||||
Reset(Input);
|
||||
TextRec(Input).Handle:=StdInputHandle;
|
||||
{ Are we redirected to a file ? }
|
||||
OutputRedir:= IsAtty(TextRec(Output).Handle)=-1;
|
||||
OutputRedir:= IsAtty(TextRec(Output).Handle)<>1;
|
||||
{ does the input come from another console or from a file? }
|
||||
InputRedir :=
|
||||
(IsAtty(TextRec(Input).Handle)=-1) or
|
||||
(IsAtty(TextRec(Input).Handle)<>1) or
|
||||
(not OutputRedir and
|
||||
(TTYName(TextRec(Input).Handle) <> TTYName(TextRec(Output).Handle)));
|
||||
{ Get Size of terminal and set WindMax to the window }
|
||||
|
||||
@ -304,7 +304,7 @@ var
|
||||
begin
|
||||
IsConsole:=false;
|
||||
{ check for tty }
|
||||
if (IsATTY(stdinputhandle)<>-1) then
|
||||
if (IsATTY(stdinputhandle)=1) then
|
||||
begin
|
||||
{ running on a tty, find out whether locally or remotely }
|
||||
ThisTTY:=TTYName(stdinputhandle);
|
||||
|
||||
@ -71,7 +71,7 @@ var
|
||||
|
||||
begin
|
||||
TTYName:='';
|
||||
if (fpfstat(handle,st)=-1) and (isatty (handle)<>-1) then
|
||||
if (fpfstat(handle,st)=-1) and (isatty (handle)<>1) then
|
||||
exit;
|
||||
mydev:=st.st_dev;
|
||||
myino:=st.st_ino;
|
||||
|
||||
@ -621,7 +621,7 @@ begin
|
||||
{$endif CPUI386}
|
||||
{ check for tty }
|
||||
ThisTTY:=TTYName(stdinputhandle);
|
||||
if (IsATTY(stdinputhandle)<>-1) then
|
||||
if (IsATTY(stdinputhandle)=1) then
|
||||
begin
|
||||
{ save current terminal characteristics and remove rawness }
|
||||
prepareInitVideo;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user