about summary refs log tree commit diff
path: root/Src/Zle/compmatch.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-12 11:52:30 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-12 11:52:30 +0000
commit984bae21ba24710ff1fd24a8b9271ca4c89efbb4 (patch)
treea97700bd94da18af12fd71d1d28cf2b483907dcb /Src/Zle/compmatch.c
parent6472a2b7bc524fbe3f543a41e8991e82e2580443 (diff)
downloadzsh-984bae21ba24710ff1fd24a8b9271ca4c89efbb4.tar.gz
zsh-984bae21ba24710ff1fd24a8b9271ca4c89efbb4.tar.xz
zsh-984bae21ba24710ff1fd24a8b9271ca4c89efbb4.zip
fixes for completion matching (11346)
Diffstat (limited to 'Src/Zle/compmatch.c')
-rw-r--r--Src/Zle/compmatch.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index 682994fdd..fe9dad41b 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -466,7 +466,9 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	bp->curpos = bc;
 	bp = bp->next;
     }
-    while (ll && lw) {
+    /*** This once was: `while (ll && lw)', but then ignored characters at
+     *   the end or not, well, ignored. */
+    while (ll) {
 
 	/* Hm, we unconditionally first tried the matchers for the cases
 	 * where the beginnings of the line and word patterns match the
@@ -576,7 +578,12 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 			     pattern_match(ap, tp - moff, NULL, NULL) &&
 			     (!aol || pattern_match(aop, tp - moff - aol,
 						    NULL, NULL)) &&
-			     match_parts(l + aoff , tp - moff, alen, part))) {
+			     (mp->wlen == -1 ||
+			      match_parts(l + aoff , tp - moff,
+						      alen, part)))) {
+			    if (!both && mp->wlen == -1 &&
+				!match_parts(l + aoff , tp - moff, alen, part))
+				break;
 			    if (sfx) {
 				savw = tp[-zoff];
 				tp[-zoff] = '\0';
@@ -1819,13 +1826,19 @@ join_clines(Cline o, Cline n)
 		    free_cline(o);
 		    x = o;
 		    o = tn;
+#if 0
+		    /*** These should be handled different from the ones
+			 that compare anchors. */
 		    if (po && po->prefix && cmp_anchors(x, po, 0)) {
 			po->flags |= CLF_MISS;
 			po->max += diff;
 		    } else {
+#endif
 			o->flags |= CLF_MISS;
 			o->max += diff;
+#if 0
 		    }
+#endif
 		    continue;
 		}
 	    }
@@ -1836,13 +1849,19 @@ join_clines(Cline o, Cline n)
 		if (tn && cmp_anchors(o, tn, 0)) {
 		    diff = sub_join(o, n, tn, 0);
 
+#if 0
+		    /*** These should be handled different from the ones
+			 that compare anchors. */
 		    if (po && po->prefix && cmp_anchors(n, pn, 0)) {
 			po->flags |= CLF_MISS;
 			po->max += diff;
 		    } else {
+#endif
 			o->flags |= CLF_MISS;
 			o->max += diff;
+#if 0
 		    }
+#endif
 		    n = tn;
 		    continue;
 		}