Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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" To: "Dan Vasaru" , References: Subject: Re: CR/NL problem with cpp.exe Date: Wed, 2 Oct 2002 08:07:03 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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" To: "Kris Warkentin" ; 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/