CR/NL problem with cpp.exe

Kris Warkentin kewarken@qnx.com
Wed Oct 2 04:53:00 GMT 2002


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@broadpark.no>
To: "Kris Warkentin" <kewarken@qnx.com>; <cygwin@cygwin.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/



More information about the Cygwin mailing list