www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/09/11:42:30

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Date: Thu, 9 May 2002 08:42:08 -0700
From: Zack Weinberg <zack AT codesourcery DOT com>
To: pavenis AT lanet DOT lv
Cc: Andris Pavenis <pavenis AT latnet DOT lv>, djgpp-workers AT delorie DOT com,
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>,
Nick Clifton <nickc AT cambridge DOT redhat DOT com>, gcc-patches AT gcc DOT gnu DOT org
Subject: Re: RFA: Ignore DOS end-of-line characters (ctrl-Z) unless -W
Message-ID: <20020509154208.GB2285@codesourcery.com>
References: <200205081853 DOT 11194 DOT pavenis AT latnet DOT lv> <3CDA764D DOT 1410 DOT A1F3EA AT localhost>
Mime-Version: 1.0
In-Reply-To: <3CDA764D.1410.A1F3EA@localhost>
User-Agent: Mutt/1.3.28i
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 Thu, May 09, 2002 at 01:14:53PM +0300, pavenis AT lanet DOT lv wrote:
> 
> OK. Here it is (tested for DJGPP with 3.1 branch)

O_TEXT, not O_BINARY.  Also, based on other discussion with Eli, the
check should apply to all file descriptors, not just stdin, so please
move it below the call to open.

zw

> --- cppfiles.c~1	Thu May  9 10:32:46 2002
> +++ cppfiles.c	Thu May  9 12:57:10 2002
> @@ -270,7 +270,13 @@
>       Special case: the empty string is translated to stdin.  */
>  
>    if (filename[0] == '\0')
> -    file->fd = 0;
> +    {
> +      file->fd = 0;
> +#ifdef __DJGPP__
> +      if (!isatty(file->fd))
> +        setmode (file->fd, O_BINARY);
> +#endif
> +    }
>    else
>      file->fd = open (file->name, O_RDONLY | O_NOCTTY | O_BINARY, 0666);

- Raw text -


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