X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Date: Wed, 08 May 2002 22:07:11 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: zack AT codesourcery DOT com Message-Id: <3942-Wed08May2002220710+0300-eliz@is.elta.co.il> X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: pavenis AT latnet DOT lv, nickc AT cambridge DOT redhat DOT com, djgpp-workers AT delorie DOT com, gcc-patches AT gcc DOT gnu DOT org In-reply-to: <20020508162338.GF20829@codesourcery.com> (message from Zack Weinberg on Wed, 8 May 2002 09:23:38 -0700) Subject: Re: RFA: Ignore DOS end-of-line characters (ctrl-Z) unless -W References: <20020508153338 DOT GE20829 AT codesourcery DOT com> <200205081853 DOT 11194 DOT pavenis AT latnet DOT lv> <20020508162338 DOT GF20829 AT codesourcery DOT com> 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 > Date: Wed, 8 May 2002 09:23:38 -0700 > From: Zack Weinberg > > if (filename[0] == '\0') > { > file->fd = 0; > #ifdef __DJGPP__ > setmode(file->fd, O_BINARY) > #endif > } > else > ... I suggest to use this instead: if (filename[0] == '\0') { file->fd = 0; #ifdef __DJGPP__ if (!isatty(file->fd)) setmode(file->fd, O_BINARY) #endif } else ... (See my other mail for the reasons.)