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

Re: using trap function to cleanup and exit?



> On 19 April 2022 at 22:22 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:


> On Tue, Apr 19, 2022 at 11:57 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> >
> > +               /*
> > +                * If the trap is primed but we've hit an explicit exit,
> > +                * we should skip any further handling and bail out now.
> > +                */
> > +               if (trap_state != TRAP_STATE_INACTIVE)
> >                     trap_state = TRAP_STATE_FORCE_RETURN;
> 
> Isn't that exactly equivalent to what I had?  TRAP_STATE_INACTIVE is
> zero, isn't it?

Correct, it was purely for clarity to keep the logic in terms of states.

pws




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