Re: sed strips CRs
Eric Blake <[email protected]>
| Newsgroups | gmane.comp.gnu.utils.bugs |
|---|---|
| Organization | Red Hat |
| Message-ID | <4F391A38.6000505__26541.5002861575$1329142384$gmane$org@redhat.com> |
[adding bug-sed - see this thread in cygwin: http://cygwin.com/ml/cygwin/2012-02/msg00313.html] On 02/11/2012 10:19 AM, Earnie Boyd wrote: >>> By this I assume you to mean that the -b option opens the input file >>> in binary mode. But the mount table the OP showed was already in >>> binary mode. Does sed not take that into consideration, I.E. it >>> specifies the mode as a text file unless -b is specified, is this >>> correct? >> >> Yes. By default files are fopened using the "rt" mode on systems >> supporting this mode. This behaviour is hardcoded into upstream sed. > > But on Linux I would expect the "t" to be ignored and the file is open > in "binary" mode anyway. 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. -- Eric Blake [email protected] +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
(application/pgp-signature, 620 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPORo4AAoJEKeha0olJ0NqK1sIAIIPRTPbeCNilqyy2uJ+i7E9 TMISfFNCagBhto0eGQYk+SU33dES1XdDmY9DYJdrZmC9ziMe/cbdWaCC820EOl1E EO9vZa3PUCNpDm6CxHnAsiiAfswIVZW3C9IRnvQpM3Z9I+rh+xepyu2ilhskN25M isfLILG4o+7t65FWzia5J0i3NQkbfb6MG9YuiM78u79Ys598scFnUilGTrfV1bl8 BpfjuUO2YOqlMrKcZzJ9rI4eAM1KyM1yHF4hI6OtlXlBJAol9RxgUbl2rz3KMKNI 3Bjje+Ui49Emb7c55MMVKI4ErEioufZQ2GdYETWZmf9WuANLJFrJKHtbK77x2uE= =AGDa -----END PGP SIGNATURE-----