X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
Message-ID: <4F39691C.1030807@gnu.org>
Date: Mon, 13 Feb 2012 20:48:44 +0100
From: Paolo Bonzini <bonzini@gnu.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0
MIME-Version: 1.0
To: John Cowan <cowan@mercury.ccil.org>
CC: cygwin@cygwin.com, bug-sed@gnu.org
Subject: Re: sed strips CRs
References: <2BF01EB27B56CC478AD6E5A0A28931F203F560E4@A1DAL1SWPES19MB.ams.acs-inc.net> <20120210150708.GA22832@calimero.vinschen.de> <CA+sc5m=UkJRKK9WZCvcfsetSUc_CHkGC-gFZEher3Tg=fK=RkQ@mail.gmail.com> <20120211100600.GA9823@calimero.vinschen.de> <CA+sc5mmnMBjBAqsuUdddEEwE5pgBDiGDkeV-H0WvEyZO08dMNA@mail.gmail.com> <4F391A38.6000505@redhat.com> <4F392012.80101@gnu.org> <20120213145612.GA8858@calimero.vinschen.de> <4F392ABC.1040309@gnu.org> <20120213194234.GA4177@mercury.ccil.org>
In-Reply-To: <20120213194234.GA4177@mercury.ccil.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 02/13/2012 08:42 PM, John Cowan wrote:
>> > By the way, I'm still opening the script file with "rt".  I cannot think
>> > of any case when you would want to keep CRs there.
> You wouldn't, but the point is that "rt" isn't defined on Posix systems.
> If it happens to be the same as "r", good, but that isn't guaranteed.

Yes, I added a configure-time check too.  I assume that if "rt" works, 
it can be used instead of "r".

> And the only time "rt" does anything different from "r" on a Win32 system
> is when you have:
>
> 1) linked your executable with the system-supplied 'binmode.obj' file
>
> 2) set the global variable _fmode to O_BINARY
>
> 3) invoked _set_fmode(O_BINARY)
>
> all of which make "r" synonymous with "rb".  Programs which don't do any
> of these should use "r" rather than "rt", as it is guaranteed to do the
> right thing for text on both Win32 and Posix systems.

No, "rt" also does something different than "r" on Cygwin with 
binary-mounts.

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.

Paolo

--
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

