This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sorry "people" (NOT MY taxonomy!!), but igncr IS flawed


Hello Jeremy,

Many thanks for your reply. To be sure, I was quite incredulous myself bash
would have problems with empty lines, but that's what happens for me.

To be precise:
- I'm running Win7-64, Home Premium SP1
- I built Cygwin by running setup.exe with all the default options. The bash
is

Manu@Holland ~
$ bash --version
GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)

- the script causing trouble comes in the GNU gdb distribution
gdb-7.3.1.tar.gz
- Notepad++ (sorry, a Win app) shows me that the problematic empty line
really contains just "[CR][LF]"
- needless to say, as I reported, ALL lines end that way (and ARE handled
correctly for most of them!), but that one is the first where "[CR][LF]" is
not preceded by anything in the line
- I'm uploading the script in case you'd find an opportunity to run it in
your Cygwin - in mine it stops with

Manu@Holland /cygdrive/d/Installs/gdb_7_3_1/gdb-7.3.1
$ ./configure
./configure: line 14: $'\r': command not found
./configure: line 29: syntax error near unexpected token `newline'
'/configure: line 29: `     ;;

Many thanks and Merry Christmas,

Emanuel


Jeremy Bopp-3 wrote:
> 
> On 12/16/2011 11:13 PM, manu0507 wrote:
>> 
>> Hi all,
>> 
>> 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.
> 
> -Jeremy
> 
> --
> 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
> 
> 
> 
http://old.nabble.com/file/p32994383/configure configure 
-- 
View this message in context: http://old.nabble.com/Sorry-%22people%22-%28NOT-MY-taxonomy%21%21%29%2C-but-igncr-IS-flawed-tp32989786p32994383.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]