delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/24/16:00:58

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Lewis Hyatt <lhyatt AT princeton DOT edu>
Subject: Re: igncr vs text mode mounts, performance vs compatibility
Date: Tue, 24 Oct 2006 18:57:06 +0000 (UTC)
Lines: 23
Message-ID: <loom.20061024T205240-509@post.gmane.org>
References: <1160655422743 DOT antti DOT nospam DOT 1605718 DOT wGO_WJ9D1NlId3tB-z6Qig AT luukku DOT com> <20061012123406 DOT GA30908 AT trixie DOT casa DOT cgf DOT cx> <452EA386 DOT 9010201 AT qualcomm DOT com> <20061012212011 DOT GA8535 AT trixie DOT casa DOT cgf DOT cx> <452EFDDB DOT 1010301 AT qualcomm DOT com> <452F8719 DOT 9060300 AT cygwin DOT com> <4536BC88 DOT 3030003 AT qualcomm DOT com> <4536C922 DOT 4090807 AT qualcomm DOT com> <45376CBF DOT 1030104 AT byu DOT net>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

> >> Are you saying that these people expect bash to treat CRLF as if the
> >> CR were non-whitespace?  Can you give me an example where this would
> >> be a useful feature?
> 
> It may not be a well-used feature, but I won't go so far as to call it not
> useful.  One possible use - a script written with \n line endings, but
> which wants to intentionally generate an output file with \r\n line
> endings (this sounds like something sharutils might want to do).  On
> Linux, literal \r in a here-doc get output to the file.  So it stands to
> reason that someone might want to do the same action on cygwin when using
> a binary mount.  Since cygwin's goal is to provide a Linux emulation, I
> don't see any reason to artificially limit cygwin by making bash always
> ignore \r; rather, I think it is only safe to ignore \r when explicitly
> told to do so (either by a text mount, or by using igncr).

Just a thought, it would probably solve 99% of people's problems if you just
specified that if the first line of the script ends in \r\n, then \r will be
ignored for the rest of the file. Then you would just need to read the first
line a byte at a time, and every subsequent line could be read efficiently
whenever possible, right? And it seems unlikely that this could possibly break
anything.

-Lewis


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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