delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/09/05:41:45

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: pavenis AT lanet DOT lv
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Thu, 9 May 2002 12:41:35 +0300
MIME-Version: 1.0
Subject: Re: RFA: Ignore DOS end-of-line characters (ctrl-Z) unless -W
Message-ID: <3CDA6E7F.23624.83781C@localhost>
In-reply-to: <1225-Wed08May2002214804+0300-eliz@is.elta.co.il>
References: <Pine DOT LNX DOT 4 DOT 21 DOT 0205081722350 DOT 26648-100000 AT gulbis DOT latnet DOT lv> (message from Andris Pavenis on Wed, 8 May 2002 17:29:18 +0300 (EEST))
X-mailer: Pegasus Mail for Windows (v4.01)
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 8 May 2002 at 21:48, Eli Zaretskii wrote:

> > Date: Wed, 8 May 2002 17:29:18 +0300 (EEST)
> > From: Andris Pavenis <pavenis AT latnet DOT lv>
> > > 
> > > I hope only when the input comes from a file, not from a terminal.
> > 
> > Had to keep binary node or should rewrite file input in gcc/ccpfiles.c 
> 
> ?? All you need to do is look at what isatty returns before you
> decide whether to switch to binary mode.
> 
> Reading from the terminal in binary mode is a bad idea: it prevents
> you from stopping input with a ^Z, for example.  It also disables
> echoing of the input, so the user types blind.
> 
> > sh-2.05$ `gcc -print-prog-name=cc1` -v
> > GNU CPP version 3.1 20020506 (prerelease) (cpplib) (80386, BSD syntax)
> > ignoring nonexistent directory "c:/djgpp/djgpp/include"
> > #include "..." search starts here:
> > #include <...> search starts here:
> >  c:/djgpp/lib/gcc-lib/djgpp/3.1/include
> >  c:/djgpp/include
> > End of search list.
> > ^Z
> > 
> > Execution times (seconds)
> >  TOTAL                 :   4.78             0.00             4.78
> 
> That doesn't look like binary input from the terminal.  Are you sure
> the call to setmode worked?
> 

You're right. I run cpp0.exe (from build of this night CVS tree of gcc-3.1 
branch) under debugger and saw that related code setting binary mode is not 
used when input is from terminal. Anyway I can move setmode for DJGPP only 
to procedure which opens file (or takes fd=0). In this case call to isatty()
is required.

Perhaps I should also leave a code in which truncates contents of file
in memory if ^Z is detected (for DJGPP only)

Andris


Andris




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019