From 8764cba90b13238d0d4bf62383cab6039508c7cf Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 26 Oct 2021 18:25:38 +0200 Subject: 49516: bail out early from matching control if command line content is too short for the coanchor --- Src/Zle/compmatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index cc4c3eca9..95eff1e92 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -693,8 +693,9 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, alen = mp->ralen; aol = mp->lalen; } /* Give up if we don't have enough characters for the - * line-string and the anchor. */ - if (ll < llen + alen || lw < alen) + * line-string and the anchor, or for both anchors in + * the case of the trial completion word. */ + if (ll < llen + alen || lw < alen + aol) continue; if (mp->flags & CMF_LEFT) { -- cgit v1.2.3