delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/02/13/09:36:18

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4F391A38.6000505@redhat.com>
References: <2BF01EB27B56CC478AD6E5A0A28931F203F560E4 AT A1DAL1SWPES19MB DOT ams DOT acs-inc DOT net> <20120210150708 DOT GA22832 AT calimero DOT vinschen DOT de> <CA+sc5m=UkJRKK9WZCvcfsetSUc_CHkGC-gFZEher3Tg=fK=RkQ AT mail DOT gmail DOT com> <20120211100600 DOT GA9823 AT calimero DOT vinschen DOT de> <CA+sc5mmnMBjBAqsuUdddEEwE5pgBDiGDkeV-H0WvEyZO08dMNA AT mail DOT gmail DOT com> <4F391A38 DOT 6000505 AT redhat DOT com>
Date: Mon, 13 Feb 2012 09:35:54 -0500
Message-ID: <CA+sc5mkR83=is0eDT-O6Tw2XxmCJEKGHwMH=W20wfePHD6VUHQ@mail.gmail.com>
Subject: Re: sed strips CRs
From: Earnie Boyd <earnie AT users DOT sourceforge DOT net>
To: cygwin AT cygwin DOT com
Cc: bug-sed AT gnu DOT org
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q1DEaEIf023358

On Mon, Feb 13, 2012 at 9:12 AM, Eric Blake wrote:
>
> 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.

I've stayed away from voicing personal feelings.  While modifying
upstream certainly would resolve the issue of CRLF being read in
"text" mode; I, on the other hand, believe that Cygwin should open the
file descriptor in binary mode regardless.  Note, though, the
difference between normal processing mode in sed and versus sed -b is
one of line mode versus buffered mode because you can't treat a binary
data file as text lines.  Modifying upstream would destroy those
systems that require 'rt' to operate in text mode and I'm not meaning
Windows; I don't know if any do.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019