X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0	tests=BAYES_00,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Date: Mon, 13 Feb 2012 14:42:34 -0500
From: John Cowan <cowan@mercury.ccil.org>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: cygwin@cygwin.com, bug-sed@gnu.org
Subject: Re: sed strips CRs
Message-ID: <20120213194234.GA4177@mercury.ccil.org>
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>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4F392ABC.1040309@gnu.org>
User-Agent: Mutt/1.5.18 (2008-05-17)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@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

Paolo Bonzini scripsit:

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

-- 
You annoy me, Rattray!  You disgust me!         John Cowan
You irritate me unspeakably!  Thank Heaven,     cowan@ccil.org
I am a man of equable temper, or I should       http://www.ccil.org/~cowan
scarcely be able to contain myself before
your mocking visage.            --Stalky imitating Macrea

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

