This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sed strips CRs

On Mon, Feb 13, 2012 at 9:12 AM, Eric Blake wrote:
> Personally, I think it is a bug that upstream sed is using 't' in
> fopen() in the first place. ÂLinux does NOT have an 'rt' mode for a
> reason: 't' is non-standard. ÂOn cygwin, the preference used in
> coreutils is that you get text mode by using 'r' and binary mode by
> using 'rb', on the mount points where text mode matters; you should
> almost never use 'rt' which forces text mode even on binary mounts.
> That is, sed should be just fine using 'r' instead of 'rt', and it would
> fix the perceived broken behavior on cygwin binary mounts.
> But fixing this should be done upstream, and not in cygwin.

I've stayed away from voicing personal feelings.  While modifying
upstream certainly would resolve the issue of CRLF being read in
"text" mode; I, on the other hand, believe that Cygwin should open the
file descriptor in binary mode regardless.  Note, though, the
difference between normal processing mode in sed and versus sed -b is
one of line mode versus buffered mode because you can't treat a binary
data file as text lines.  Modifying upstream would destroy those
systems that require 'rt' to operate in text mode and I'm not meaning
Windows; I don't know if any do.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]