From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22259 invoked by alias); 4 Aug 2010 15:28:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28127 Received: (qmail 20343 invoked from network); 4 Aug 2010 15:28:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at spf-1.redhat.com designates 209.132.183.28 as permitted sender) Message-ID: <4C5986DC.1080809@redhat.com> Date: Wed, 04 Aug 2010 09:27:24 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1 MIME-Version: 1.0 To: John Lumby CC: zsh-workers@zsh.org, autoconf maillist , libtool-patches@gnu.org, mikachu@gmail.com Subject: Re: Fix testsuite errors due to shell quoted parameter expansion issue. References: <20100803203204.GG13690@gmx.de>, <4C588248.9050807@redhat.com>, In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigA3D5EFDBB70F804ACC3BD773" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 --------------enigA3D5EFDBB70F804ACC3BD773 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [please don't top-post on technical lists] On 08/04/2010 09:18 AM, John Lumby wrote: >=20 > Re the statement >=20 > since "$e" is quoted, it must not be elided >=20 > I don't think that is correct. In fact "$e" *must* be elided - beca= use you juxtaposed it with the next token. eliding and quoting are ort= hogonal. Your statement is confusing to me. Here, in more detail, is exactly what I meant (and what I though I implied in the first case): The word in question is '"$e"$f' before either parameter substitution, or word splitting, or quote elision. After parameter substitution, you are left with '"" val', where a portion of the string was originally quoted, but you also had a portion of the string that was unquoted. Only the ' val' portion of the result is subject to word splitting. Because "$e" is quoted, the resulting empty string must not be elided during word splitting. Therefore, the result after word splitting MUST be the two words '""' and 'val'; then you apply quote elision and are left with two words: '' and 'val'. >=20 > What you appear to be be expecting is that the effect of quoting one to= ken should somehow have some effect on interpretation of a special charac= ter (blank) in a subsequent unquoted token. I don't think that is expec= ted behaviour. The quoting of $e has the effect of quoting any speci= al characters inside *it*, of which there are none. your blank is unq= uoted. Then word-spilling proceeds. No, what I expect is that within a single word, the quoted portion of the word must not be elided during word splitting, except in the special case of "$@". >=20 > What I find interesting is this >=20 > bash -c 'declare -i length; f=3D" val" e=3D;concat=3D"$e"$f; length=3D$= {#concat}; echo "length=3D $length"' > 4 Why do you find that interesting? There is NO word splitting in assignment contexts, so the effect of concat=3D"$e"$f is the same as if you had done concat=3D$e$f or concat=3D"$e$f" in all three cases, concat is assigned the value ' val', which is indeed length 4. But it is unrelated to the bash bug at hand, which is that when "$e"$f is in a context subject to word splitting, then it must result in the two words '' and 'val', not the single word 'val'. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigA3D5EFDBB70F804ACC3BD773 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJMWYbcAAoJEKeha0olJ0NqgaAH/Ru6k5vgPYPPk0ReR+hPBLEp Hnx1b7/oVXvs6iRNFFtT79wdLjwQFneOKugS6ln3vwaF7Jj0J+ggxgQ/6IRmnrND lf3pnbizTmXS3HUp0d7EneOTv4v58o3OLCimTEANvIX75BGCNHU4YvBs9tg7y0eq 30CNS2t9EJlpmj8XQz41JUjccy3t/F7Ulwzuq9Rgl7BpK1L/n0XXMnnFvWSoHwRr W4gUT1nuWrEn72qZNyYmfQV7wAUrrsBcP3HlTf1JKeSIQK9ogmNiTaHd8IPh4HYh 2Gk+HR50KJ1cQggsnTe7X6psLfpf0lVzFyKn5IdFAmo1iLKD69x3nljvHQWXizk= =W77k -----END PGP SIGNATURE----- --------------enigA3D5EFDBB70F804ACC3BD773--