diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/Zle/compmatch.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 8063154f5..abdab0ffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-10-26 Oliver Kiddle <opk@zsh.org> + + * 49516: Src/Zle/compmatch.c: bail out early from matching + control if command line content is too short for the coanchor + 2021-10-24 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> * 49520: Etc/completion-style-guide: document $_args_cache_cmd 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) { |