Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: local_traps doesn't restore traps set from functions
- X-seq: zsh-workers 45797
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: local_traps doesn't restore traps set from functions
- Date: Sat, 9 May 2020 14:14:42 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <CAN=4vMqXCy=NyVa1CRRU-oe7jyeGGrVTqyNq=M8_Qr4eChH4SA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMrq8S=W+C8Vcp_pZGkc0eNymK3d+x0E3yib6BHu5ZRhDg@mail.gmail.com> <20200507212136.3ff1a843@tarpaulin.shahaf.local2> <CAN=4vMqXCy=NyVa1CRRU-oe7jyeGGrVTqyNq=M8_Qr4eChH4SA@mail.gmail.com>
Roman Perepelitsa wrote on Fri, 08 May 2020 08:51 +0200:
> On Thu, May 7, 2020 at 11:21 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > The following patch fixes it:
>
> Thanks for the patch. I confirm that it works. I've tried a handful of
> different combinations of traps and all work as expected.
>
Thanks for testing.
> One stylistic suggestion for the patch: replace sigtrapped[i] fixup with this:
>
> sigtrapped[i] -= 1 << ZSIG_SHIFT;
>
> It'll align the code with the preceding comment to the point of making
> the comment superfluous. I also find it easier to understand although
> that may be subjective.
Good point, thanks. Perhaps it'd be clearer if I wrapped the first
disjunct by a macro, so it'd have a name and a doc string:
/* ... */
static unsigned int low_N_bits_of(unsigned arg, unsigned char N) { return arg & ((1u << N)-1u); }
(Function, rather than macro, for type safety in case the arguments are
passed in the wrong order.)
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author