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 To: pavenis AT lanet DOT lv Cc: Andris Pavenis , djgpp-workers AT delorie DOT com, Eli Zaretskii , Nick Clifton , 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Precedence: bulk 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);