delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/12/17/01:41:36

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
X-Mail-Handler: MailHop Outbound by DynDNS
X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX1/lgG5RbbijCkn9qJVOYPVa
Date: Sat, 17 Dec 2011 01:41:04 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Sorry "people" (NOT MY taxonomy!!), but igncr IS flawed
Message-ID: <20111217064104.GA7997@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <32989786 DOT post AT talk DOT nabble DOT com> <4EEC34F4 DOT 9090409 AT bopp DOT net>
MIME-Version: 1.0
In-Reply-To: <4EEC34F4.9090409@bopp.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
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

On Sat, Dec 17, 2011 at 12:21:40AM -0600, Jeremy Bopp wrote:
>On 12/16/2011 11:13 PM, manu0507 wrote:
>>Notwithstanding the completely preposterous "reply" by Eric Blake (more
>>of an idiotic acrimony, actually) to my previous post (see
>>http://old.nabble.com/Igncr-ineffective--tt32983438.html ), there does
>>seem to be a problem in dealing with Win's CR/LF line endings in
>>"unusual" lines, at least on Win7-64 (or, to be really precise, on my
>>Win7-64).  The lines where CR/LFs appear not to be properly converted
>>to LFs seem to be empty lines (except for the CR/LF, of course), as
>>well as some other "unusual" constructs (lines ending with ";;CR/LF" in
>>particular).
>
>I don't have Cygwin available at the moment, so I can't try running
>scripts as you describe right now.  However, the claim that a line
>consisting of only a CR/LF causing problems with the igncr option makes
>me pretty suspicious.  "Empty" lines are pretty darn common in bash
>scripts, and I would expect to have seen many reports of problems with
>igncr reported here by now if that option didn't correctly handle those
>lines.
>
>Can you send a representative example script that elicits this problem
>for you?  A simple test case would go a long way to addressing the
>issue.  From the sound of things, no one else has reproduced your issue
>yet.
>
>Perhaps the lines that are giving you trouble are actually ended with
>CR/CR/LF.  Have you examined the problematic scripts with a hex editor
>or simply "od -c" to verify the line endings?
>
>>To work around the problem, I'm writing an application that would
>>convert all CR/LF-ending text files into LF-ending ones...  but it's
>>not really trivial, because telling binary files that should be left
>>untouched from text files that should be converted is difficult: even
>>the very first file in GDB's sources ("configure") contains a '\a',
>>i.e.  a "not-text" byte.
>
>While it's not a complete solution by itself, I hope you're using the
>dos2unix or d2u programs to handle the conversion.  You may also be
>able to make use of the file program from the file package to help
>identify files that are appropriate for conversion.  Given that the
>igncr option is only useful for bash and maybe sh, scripts for those
>are probably the only ones you want to convert, and the file program
>should be able to identify them for you.

Hats off to you, Jeremy, for your civility in responding to this rant.

cgf

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