bug#25707: [PATCH] grep: don't forcefully strip carriage returns

2017-02-13 Thread Eric Blake
Commit 5c92a54 made the mistaken assumption that using fopen("rt") on platforms where O_TEXT is non-zero makes sense. However, POSIX already requires fopen("r") to open a file in text mode, vs. fopen("rb") when binary mode is wanted, and at least on Cygwin, where it is possible to control whether

bug#25707: [PATCH] grep: don't forcefully strip carriage returns

2017-02-13 Thread Paul Eggert
On 02/13/2017 11:23 AM, Eric Blake wrote: the use of fopen("rt") actively breaks assumptions on a binary mount by silently corrupting any carriage returns that are supposed to be preserved. Surely it's more typical for trailing CRs to be ignored rather than be preserved, even on binary mounts.

bug#25707: [PATCH] grep: don't forcefully strip carriage returns

2017-02-13 Thread Eric Blake
On 02/13/2017 02:00 PM, Paul Eggert wrote: > On 02/13/2017 11:23 AM, Eric Blake wrote: >> the use of fopen("rt") actively >> breaks assumptions on a binary mount by silently corrupting any >> carriage returns that are supposed to be preserved. > > Surely it's more typical for trailing CRs to be ig