Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: errexit and (Z)ERR trap regression
- X-seq: zsh-workers 52978
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: errexit and (Z)ERR trap regression
- Date: Thu, 27 Jun 2024 09:43:51 -0700
- Archived-at: <https://zsh.org/workers/52978>
- In-reply-to: <CAGdYchuRvp3swLy-eUXaSu4QK0UHsN3Jbyp58pz35M9mQTO=dg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <5d54375e-8673-45f0-b5ac-f5e0e233d56f@inlv.org> <CAH+w=7YatfKy+vFT1dua5-6cxsgXDaj=GA2qye_nC7fWQ1xUSQ@mail.gmail.com> <2a5f0fa7-23bf-4069-b237-d304965f142e@app.fastmail.com> <CAH+w=7ZZsBk6uibaSfLNmvNGf8Uwv1FQ7nZAuPz2xB7zMjh4rQ@mail.gmail.com> <33ca21c3-69f8-49f7-9350-2ff9cc4febca@app.fastmail.com> <CAH+w=7YrF3RMjqY6RJKjH=o8pTziok08aAx4g8gfff9_KYdVuQ@mail.gmail.com> <CAGdYchvP9x83UtFH855_ddE1m88cMJdNmk27+RwzHC9KSJ=ucA@mail.gmail.com> <CAH+w=7YWCGtkbZZY2f4gWdZ624hz+4xBhFfZbaoyZGhETu-3WA@mail.gmail.com> <CAGdYchuRvp3swLy-eUXaSu4QK0UHsN3Jbyp58pz35M9mQTO=dg@mail.gmail.com>
On Wed, Jun 26, 2024 at 7:01 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> It's true that in the first iteration of the while loop, the noerrexit = oldnoerrexit is always a nop. However, that isn't the case for subsequent iterations and in particular for the last iteration where it's important to always restore noerrexit to its original value (i.e., oldnoerrexit) even if that value isn't equal to 0.
>
> Now that I see this code under this angle, I think that a better version is one where noerrexit = oldnoerrexit is placed after the switch statement.
Ok, this makes much more sense to me than the previous patch. Thanks
for digging in.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author