delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/10/02/07:54:15

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <001501c26a0c$38db6790$2a00a8c0@dash>
From: "Kris Warkentin" <kewarken AT qnx DOT com>
To: "Dan Vasaru" <dvasaru AT broadpark DOT no>, <cygwin AT cygwin DOT com>
References: <CHEDKHJJDLOCCOFLMGEAGEACCNAA DOT dvasaru AT broadpark DOT no>
Subject: Re: CR/NL problem with cpp.exe
Date: Wed, 2 Oct 2002 08:07:03 -0400
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

I agree.  It's just that the util I'm looking at is GNU cpp, which DOES have
a cygwin specific port but doesn't seem to deal with the CRLF problem.  So
we've got the situation that, for whatever reason, it doesn't look like all
the Cygwin changes were rolled into the public branch which is the puzzle.
I'm wondering if there is some reason why but I'm agreeing with you and I
think I might just hack the preprocessor to properly deal with the '\r'.
Probably the most portable way.

cheers,

Kris
----- Original Message -----
From: "Dan Vasaru" <dvasaru AT broadpark DOT no>
To: "Kris Warkentin" <kewarken AT qnx DOT com>; <cygwin AT cygwin DOT com>
Sent: Tuesday, October 01, 2002 5:02 PM
Subject: RE: CR/NL problem with cpp.exe


> Kris,
>
> I am no authority on the matter, but I believe most Cygwin/Win32 ports of
> "text-based" utilities deal with CRLF/LF by setting the O_TEXT flag and
> letting the (C) runtime translate the line endings for them.
>
> Instead of adjusting the file input mode, please note that you may want to
> adjust your preprocessor lexer to accept both styles of line endings.
> What happens the day you will want to port your CPP to a true Unix, and
will
> get a DOS file as an input ? Unix will blissfully ignore the O_TEXT flag
in
> open() calls, and you'll have CR on your input pipe.
>
> GREP is an example of a utility that *doesn't* use O_TEXT, and still
handles
> all styles of line terminations gracefully. At least in principle.
>
> Dan.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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