delorie.com/archives/browse.cgi | search |
On Mon, Feb 13, 2012 at 2:48 PM, Paolo Bonzini wrote: > > If you meant that "rt" should be restricted to cygwin, that's also fine by > me but in general I prefer feature tests to OS tests. > Then it becomes Cygwin's problem. I'm going to quote from http://msdn.microsoft.com/en-us/library/yeby3zcb.aspx <quote> t Open in text (translated) mode. In this mode, CTRL+Z is interpreted as an EOF character on input. In files that are opened for reading/writing by using "a+", fopen checks for a CTRL+Z at the end of the file and removes it, if possible. This is done because using fseek and ftell to move within a file that ends with CTRL+Z may cause fseek to behave incorrectly near the end of the file. In text mode, carriage return–linefeed combinations are translated into single linefeeds on input, and linefeed characters are translated to carriage return–linefeed combinations on output. When a Unicode stream-I/O function operates in text mode (the default), the source or destination stream is assumed to be a sequence of multibyte characters. Therefore, the Unicode stream-input functions convert multibyte characters to wide characters (as if by a call to the mbtowc function). For the same reason, the Unicode stream-output functions convert wide characters to multibyte characters (as if by a call to the wctomb function). </quote> So does Cygwin really want to specify "rt"? I would rather sed specify "rb" and treat the CR as white space. I know that treating CR as white space works well. -- Earnie -- https://sites.google.com/site/earnieboyd -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |