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" <[EMAIL PROTECTED]> To: "Kris Warkentin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> 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/