Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: crash with weird completer
- X-seq: zsh-workers 49916
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: crash with weird completer
- Date: Tue, 29 Mar 2022 18:11:38 +0200
- Archived-at: <https://zsh.org/workers/49916>
- List-id: <zsh-workers.zsh.org>
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