[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unbreak Cygwin bash igncr mode with ac_cr

From: Eric Blake
Subject: Re: Unbreak Cygwin bash igncr mode with ac_cr
Date: Thu, 08 Jan 2009 20:18:38 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20081209 Thunderbird/ Mnenhy/

Hash: SHA1

According to Aaron W. LaFramboise on 1/8/2009 3:13 AM:
> The addition of the ac_cr code to config.status broke running in Cygwin
> bash's igncr mode.  When run in such a mode, ./configure fails as follows.

Is this on a text mode or binary mode mount point?  Text mode mounts have
so many other problems that I'm not inclined to look at it there; I prefer
sticking to binary mode mounts, and I don't use the cygwin-specific igncr
bash option (even though I implemented it).

> The problem is that the ac_cr variable ends up being empty.  The recent
> change to use tr instead of a bare carriage return has no effect on this.
> One way to solve this is to just skip the conversion step if igncr is
> set, which can be detected by checking for the empty ac_cr variable.
> I've attached a patch that implements this solution and seems to fix the
> problem for me.
> What do you guys think about this?

In igncr mode, bash eats \r in the original script, as well as in text
collected during ``; but does not eat it during variable expansion.  As
you noted, the problem is getting the carriage return into the variable;
once it is there, we can get it back out.  And there are other ways to get
to a carriage return: what about adding this alternative to set ac_cr if
the first two fail?  It uses a non-portable feature of $'\r', but by
hiding it behind eval and feature tests, hopefully we won't upset other
shells.  I tried it on a binary mount.

$ uname
$ shopt -s igncr
$ eval ac_cr=\$\'\\r\'
$ echo "a${ac_cr}b" | od -tx1
0000000 61 0d 62 0a

Since cygwin is the only system that has igncr (at least for now, since I
haven't proposed it to Chet for upstream inclusion, and since it missed
the cutoff for bash 4.0 features), and since cygwin always has bash
available, we might be able to make carriage returns work in spite of the
igncr mode.

But yes, like Ralf suggested, I'd be interested in your testsuite results
with and without igncr and/or a patch along these lines.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

[Prev in Thread] Current Thread [Next in Thread]