From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20414 invoked by alias); 3 Jun 2011 19:16:41 -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: 29449 Received: (qmail 1669 invoked from network); 3 Jun 2011 19:16:30 -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: <4DE93308.7000105@redhat.com> Date: Fri, 03 Jun 2011 13:16:24 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 MIME-Version: 1.0 To: Mikael Magnusson CC: zsh-workers@zsh.org Subject: Re: regression in ${##""} References: <4DE9212A.2080601@redhat.com> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig32011987EF267CB236051A87" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 --------------enig32011987EF267CB236051A87 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/03/2011 12:55 PM, Mikael Magnusson wrote: > On 3 June 2011 20:00, Eric Blake wrote: >> POSIX requires ${##""} to be parsed as ${parameter#word} with paramete= r >> of # and word of "", which results in the output of $# with the shorte= st >> prefix of the empty string removed (aka ${#}). But current zsh.git >> rejects this: >> >> $ ./Src/zsh -c 'set a b; echo ${##""}' >> zsh:1: bad substitution >> >> Worse, this is a regression: >> >> $ zsh -c 'set a b; echo ${##""}' >> 2 >> $ rpm -q zsh >> zsh-4.3.10-5.fc14.x86_64 >=20 > Not a surprise, this is due to >=20 > 28889: ${##} should return the length of $# Before you go changing anything, though, I just filed a bug against POSIX= : http://austingroupbugs.net/view.php?id=3D457 which recommends that ${parameter#word} and ${parameter##word} be changed to be unspecified if parameter is #; this relaxation in the standard would permit current zsh behavior. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig32011987EF267CB236051A87 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJN6TMIAAoJEKeha0olJ0NqBfoH/2RoVSm0tUiLaO+sHLq3GM0T wtJus8TRI/hwE45TICE/2WmZg7ClBL+YFhBCyNHa3t65FA+MkU9VMFh73/l3odlV C6wyZjCnx2iOFqpu6H572ictifC5T/I3/eOlQfMlra2dNPVYwT1ZYdv/u5VPO3Gj 3dTAuhODpdK3HKOVCi5eqt6+c2tXMoEMiqGEyP1+QDk2m6qD4dhnH/SIKp0oO3oW +WZ3SBzIS2W07Asz3Mwob8Ig9QN2swufmv3WCy8c62I7SOaSBdZR3QJBp9ywJsnN +e9i5Muk3/a8LhXKkRg1UKoDWwrFCzl5q0N1jFrkZ0ZESgr+yHQMAgJLhgSfSd4= =Dq1K -----END PGP SIGNATURE----- --------------enig32011987EF267CB236051A87--