From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8694 invoked from network); 14 Sep 2002 00:58:58 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Sep 2002 00:58:58 -0000 Received: (qmail 9407 invoked by alias); 14 Sep 2002 00:58:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17669 Received: (qmail 9388 invoked from network); 14 Sep 2002 00:58:40 -0000 To: Peter Stephenson Cc: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: For loop bug References: <20020913233156.324A31C0E9@pwstephenson.fsnet.co.uk> From: Philippe Troin Date: 13 Sep 2002 17:58:34 -0700 In-Reply-To: <20020913233156.324A31C0E9@pwstephenson.fsnet.co.uk> Message-ID: <871y7xs7yd.fsf@ceramic.fifi.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: Philippe Troin Peter Stephenson writes: > Philippe Troin wrote: > > Tried on zsh 4.0.4 and 4.0.6: > >=20 > > % for i in 1 2 3; do echo $i || break; done && echo X > > 1 > > X > > 2 > > X > > 3 > > X > > X > > %=20 > >=20 > > That looks somewhat incorrect... >=20 > Oh, *yuk*. >=20 > > Or did I miss something? >=20 > Non, h=E9las. >=20 > The wordcode is pretty horrific to debug: it's uncommented and as an > unstructured array of integers completely opaque to all debugging tools. > Tentative patch below --- passes all tests, including the new one (which > Philippe will recognise). It's actually against 4.1, but I doubt if > much has changed here. >=20 > I may leave this till Monday for people to scratch their heads over. Does it fix this one as well? % for i in 1 2 3; do { {echo $i; [[ $i =3D=3D 2 ]] && exit 1; } || break = }; \ > done && echo X 1 X %=20 I would have expected: 1 2 X=20 or=20 1 2 But surely not 1 X. Phil.