Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [Bug] comparisson operator `[[` not working as expected
- X-seq: zsh-workers 50380
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Paulo Diovani <paulo@xxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [Bug] comparisson operator `[[` not working as expected
- Date: Tue, 21 Jun 2022 02:47:42 +0200
- Archived-at: <https://zsh.org/workers/50380>
- In-reply-to: <CAH+w=7YnmfM3g6j9TB6NXHcFE7yTSY3-UG8wKg1OicwSgj3VZw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CABdM12-XmzJNFECJto8hR0YROQOuq71p20Hb9jVAx6YNyF2RDg@mail.gmail.com> <CAH+w=7YnmfM3g6j9TB6NXHcFE7yTSY3-UG8wKg1OicwSgj3VZw@mail.gmail.com>
On 6/20/22, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Mon, Jun 20, 2022 at 11:33 AM Paulo Diovani <paulo@xxxxxxxxxxx> wrote:
>>
>> In version 5.9 the [[ ]] operator is behaving unexpectedly for the
>> following case:
>
> Yep, this is a bug, introduced when a different crashing bug was
> fixed. It's an off-by-one error skipping the first job in the table.
>
> The relevant ChangeLog entry for the crash bug is
>
> 2022-03-30 Peter Stephenson <p.stephenson@xxxxxxxxxxx>
>
> * 49906 (Bart), 49911: Doc/Zsh/builtins.yo,
> Doc/Zsh/mod_parameter.yo, Src/exec.c, Src/jobs.c,
> Test/W03jobparameters.ztst: Fix querying jobs in subshell.
>
> diff --git a/Src/jobs.c b/Src/jobs.c
> index e0e453ed8..25ceb81c4 100644
> --- a/Src/jobs.c
> +++ b/Src/jobs.c
> @@ -2402,7 +2402,7 @@ bin_fg(char *name, char **argv, Options ops, int
> func)
> int curmaxjob, ignorejob;
> if (unset(MONITOR) && oldmaxjob) {
> jobptr = oldjobtab;
> - curmaxjob = oldmaxjob ? oldmaxjob - 1 : 0;
> + curmaxjob = oldmaxjob ? oldmaxjob : 0;
Isn't this now just a very funny way to spell
curmaxjob = oldmaxjob;
?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author