summaryrefslogtreecommitdiff
path: root/Src/Zle/compmatch.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
commit31bcc5c263aea983e967426e2b94269e7605dcd4 (patch)
tree7b48ad9d7799afe09b7d7d8adc980bd5db935bdf /Src/Zle/compmatch.c
parent5086b5356abcef8849dc8a09902b7c55f01db3c0 (diff)
parentb09f4483416c54c1782824633dfabaf2ec0265b6 (diff)
downloadzsh-31bcc5c263aea983e967426e2b94269e7605dcd4.tar.gz
zsh-31bcc5c263aea983e967426e2b94269e7605dcd4.zip
Update upstream source from tag 'upstream/5.8.1.2-test'
Update to upstream version '5.8.1.2-test' with Debian dir b380d582bf51cd93149e4dea28fffa1ad85db4f5
Diffstat (limited to 'Src/Zle/compmatch.c')
-rw-r--r--Src/Zle/compmatch.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index cc4c3eca9..bb8359f1d 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) {
@@ -1318,7 +1319,7 @@ pattern_match_equivalence(Cpattern lp, convchar_t wind, int wmtp,
convchar_t lchr;
int lmtp;
- if (!PATMATCHINDEX(lp->u.str, wind-1, &lchr, &lmtp)) {
+ if (!PATMATCHINDEX(lp->u.str, wind, &lchr, &lmtp)) {
/*
* No equivalent. No possible match; give up.
*/
@@ -1437,7 +1438,7 @@ pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen,
/*
* If either is "?", they match each other; no further tests.
- * Apply this even if the character wasn't convertable;
+ * Apply this even if the character wasn't convertible;
* there's no point trying to be clever in that case.
*/
if (p->tp != CPAT_ANY || wp->tp != CPAT_ANY)
@@ -1495,7 +1496,7 @@ pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen,
* characters. We're matching two patterns against
* one another to generate a character to insert.
* This is a bit too psychedelic, so I'm going to
- * bale out now. See you on the ground.
+ * bail out now. See you on the ground.
*/
return 0;
}
@@ -1563,7 +1564,7 @@ pattern_match(Cpattern p, char *s, Cpattern wp, char *ws)
c = unmeta_one(s, &len);
/*
* If either is "?", they match each other; no further tests.
- * Apply this even if the character wasn't convertable;
+ * Apply this even if the character wasn't convertible;
* there's no point trying to be clever in that case.
*/
if (p->tp != CPAT_ANY || wp->tp != CPAT_ANY)
@@ -1933,7 +1934,7 @@ bld_line(Cmatcher mp, ZLE_STRING_T line, char *mword, char *word,
* This is the nightmare case: we have line and
* and word matchers and some pattern which restricts
* the value on the line without us knowing exactly
- * what it is. Despatch to the special function
+ * what it is. Dispatch to the special function
* for that.
*/
if (mp && !mp->flags && mp->wlen <= wlen &&