* fix isatty return value checks

git-svn-id: trunk@1292 -
This commit is contained in:
peter 2005-10-05 06:50:16 +00:00
parent c3a5f88a7b
commit 9ea69cfec9
4 changed files with 6 additions and 6 deletions

View File

@ -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 }

View File

@ -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);

View File

@ -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;

View File

@ -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;