about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2021-10-26 18:25:38 +0200
committerOliver Kiddle <opk@zsh.org>2021-10-26 18:25:38 +0200
commit8764cba90b13238d0d4bf62383cab6039508c7cf (patch)
treebabad068f2838bb71218a7004b60e0bded647f63 /Src/Zle
parentb4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4 (diff)
downloadzsh-8764cba90b13238d0d4bf62383cab6039508c7cf.tar.gz
zsh-8764cba90b13238d0d4bf62383cab6039508c7cf.tar.xz
zsh-8764cba90b13238d0d4bf62383cab6039508c7cf.zip
49516: bail out early from matching control if command line content is too short for the coanchor
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/compmatch.c5
1 files changed, 3 insertions, 2 deletions
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) {