delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/11/04/20:50:25

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Thu, 4 Nov 2004 20:50:20 -0500
Message-Id: <200411050150.iA51oKKB009552@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <418AD91D.9C49C24E@yahoo.com> (message from CBFalconer on Fri, 05
Nov 2004 01:39:01 GMT)
Subject: Re: Missing '\r' from stdin
References: <418AD91D DOT 9C49C24E AT yahoo DOT com>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> After beating my head against something, I have come to the
> conclusion that fgets() in DJGPP 2.03 (and maybe getc etc too)
> simply suppress any isolated \r.  I expected that suppression would
> only occur when followed by \n (cr/lf).  This is using stdin
> undiddled, i.e. as a text file.
> 
> Does anyone know if this is correct?

DJGPP has always done that.  In text mode, \r's are simply deleted
when encountered.  This is very efficient, compatible with other
compilers, and if you have a bare \r in a TEXT file, you have an
invalid text file, so legally we can do whatever we want with it.

We've tried smarter solutions, but they've never worked out.

- Raw text -


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