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

Re: PATCH: crash with weird completer



On 3/10/22, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
> index 8b5955819a..0fed297b56 100644
> --- a/Src/Zle/compresult.c
> +++ b/Src/Zle/compresult.c
> @@ -612,9 +612,10 @@ instmatch(Cmatch m, int *scs)
>         int pcs = zlemetacs;
>
>         l = 0;
> -       for (bp = brbeg, brpos = m->brpl,
> -                bradd = (m->pre ? strlen(m->pre) : 0);
> -            bp; bp = bp->next, brpos++) {
> +       bradd = (m->pre ? strlen(m->pre) : 0);
> +       for (bp = brbeg, brpos = m->brpl;
> +            bp && brpos;
> +            bp = bp->next, brpos++) {
>             zlemetacs = a + *brpos + bradd;
>             pcs = zlemetacs;
>             l = strlen(bp->str);

I haven't noticed any extra problems as a result of using this patch,
so I'm just resubmitting it without the RFC tag, lest anyone be
surprised when I commit it later.

-- 
Mikael Magnusson




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