autoconf
[Top][All Lists]
Advanced

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

Re: coreutils-5.1.3 released: bug-fix-only, candidate for stable 5.2.0


From: Paul Eggert
Subject: Re: coreutils-5.1.3 released: bug-fix-only, candidate for stable 5.2.0
Date: 12 Feb 2004 01:24:07 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Daniel Jacobowitz <address@hidden> writes:

> >   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
> >   ac_i=`echo "$ac_i" | sed "$ac_script"`
> 
> By the way, something I noticed a few months ago when fixing quoting
> bugs in GCC: this style of code triggers all sorts of problems with dash
> (formerly called ash) at least as of 0.4.21 and a few earlier versions.
> For example:
> 
> $ a='a\b'
> $ set | grep '^a='
> a='a\b'
> $ echo "$a"
> a
> $
> 
> i.e. the \b is processed.  This interacts very badly with
> --program-transform-name='s/g\(.*\)/g\1-3.4/',

Hmm, but your script doesn't necessarily indicate any problem with
--program-transform-name.

POSIX says that the last echo is equivalent to

$ echo 'a\b'

and that the results are implementation-defined, since 'echo' has
undefined behavior if its operands contain a backslash.  (On
XSI-conformant systems, the system must print a backslash; perhaps
that's what ash did.)

--program-transform-name doesn't pass backslash to echo, so it won't
run into that problem.

For example, with POSIX you must get this behavior:

$ a='a\b'
$ expr "X$a" : 'X\(.*\)'
a\b




reply via email to

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