[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed strips CRs

From: Eric Blake
Subject: Re: sed strips CRs
Date: Mon, 13 Feb 2012 07:12:08 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0

[adding bug-sed - see this thread in cygwin:

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   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]