Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: For loop bug
- X-seq: zsh-workers 17669
- From: Philippe Troin <phil@xxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: For loop bug
- Date: 13 Sep 2002 17:58:34 -0700
- Cc: zsh-workers@xxxxxxxxxxxxxx (Zsh hackers list)
- In-reply-to: <20020913233156.324A31C0E9@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20020913233156.324A31C0E9@xxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: Philippe Troin <phil@xxxxxxxx>
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx> writes:
> Philippe Troin wrote:
> > Tried on zsh 4.0.4 and 4.0.6:
> > 
> >   % for i in 1 2 3; do echo $i || break; done && echo X
> >   1
> >   X
> >   2
> >   X
> >   3
> >   X
> >   X
> >   % 
> > 
> > That looks somewhat incorrect...
> 
> Oh, *yuk*.
> 
> > Or did I miss something?
> 
> Non, hélas.
> 
> 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.
> 
> 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 == 2 ]] && exit 1; } || break }; \
  > done && echo X
  1
  X
  % 
I would have expected:
  1
  2
  X 
or 
  1
  2
But surely not 1 X.
Phil.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author