Thread (5 messages) flat view 5 messages, 2 authors, 2016-08-11

Re: [PATCH] git-parse-remote: fix ambiguous shell bug in expand_refs_wildcard

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2016-06-15 22:43:08

On Mon, May 07, 2007 at 02:36:22AM -0400, Jeff King wrote:
It looks like bash is actually broken in POSIXLY_CORRECT mode, then:

$ echo $BASH_VERSION
3.1.17(1)-release
$ POSIXLY_CORRECT=1
$ foo=bar}
$ echo "${foo%'}'}"
bar

My interpretation of the correct behavior is that it should remove a
single quote from the end of foo, and then print '} literally (that is,
single quote and brace).
Well strictly speaking this is allowed by the standard as this usage
contains an odd number of single quotes inside an ${...} expression
enclosed by double quotes, which behaves in an implementation-specific
manner.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help