Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: TRAPZERR() in chpwd()



Peter Stephenson wrote:

> Sven wrote
> > It made things like `false && echo a; echo b' fail. The `echo b'
> > wasn't executed.
> >
> > The simplest way to solve this is by saving and
> > restoring donetrap around the execution of the pipelines.
> > 
> > 
> > I haven't committed the patch... does anyone see a problem with it?
> 
> Yes, the `donetrap' test which makes sure that the trap is only executed
> once for each occurrence of a non-zero return status isn't working.  (I
> think this is pretty much the only reason for having donetrap as a static
> variable, so saving it and restoring it essentially disables its staticness
> altogether, although there may well be some subtlety I'm missing.)

At least the things I triend my patch with work.

> % trap 'print ERRR-or!' ZERR
> % f() { false; }
> % f
> ERRR-or!
> ERRR-or!
> 
> How about a less drastic version of my previous patch?  I think the point
> is that we just need the `donetrap' effect but not the goto effect

Yep.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author