about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-17 13:05:28 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-17 13:05:28 +0000
commit9e2205fbe79aedb8432494c195decd2474f7d72c (patch)
treee08deedb0d85a3a2a2a95c9fd010b2a8bba2be38 /Src
parentedf58408576053fbe1592f807fc4b28ee5ed4366 (diff)
downloadzsh-9e2205fbe79aedb8432494c195decd2474f7d72c.tar.gz
zsh-9e2205fbe79aedb8432494c195decd2474f7d72c.tar.xz
zsh-9e2205fbe79aedb8432494c195decd2474f7d72c.zip
zsh-workers/7441
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_tricky.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index a279c8de3..002c0e16c 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2147,7 +2147,7 @@ add_match_str(Cmatcher m, char *l, char *w, int wl, int sfx)
 	wl = m->llen; w = l;
     }
     if (wl) {
-	/* Probably resie the buffer. */
+	/* Probably resize the buffer. */
 	if (matchbuflen - matchbufadded <= wl) {
 	    int blen = matchbuflen + wl + 20;
 	    char *buf;
@@ -3458,21 +3458,35 @@ join_clines(Cline o, Cline n)
 		for (t = n; (tn = t->next) && !cmp_anchors(o, tn, 1); t = tn);
 
 		if (tn) {
-		    Cline t;
-
 		    t = tn->prefix; tn->prefix = n->prefix; n->prefix = t;
 		    t = tn->suffix; tn->suffix = n->suffix; n->suffix = t;
 		    n = tn;
+		    o->flags |= CLF_MISS;
 		    continue;
 		} else {
-		    if (o->flags & CLF_SUF)
-			break;
+		    for (t = o; (tn = t->next) && !cmp_anchors(n, tn, 1);
+			 t = tn);
+
+		    if (tn) {
+			t = tn->prefix; tn->prefix = o->prefix; o->prefix = t;
+			t = tn->suffix; tn->suffix = o->suffix; o->suffix = t;
+			if (po)
+			    po->next = tn;
+			else
+			    oo = tn;
+			o = tn;
+			o->flags |= CLF_MISS;
+			continue;
+		    } else {
+			if (o->flags & CLF_SUF)
+			    break;
 
-		    o->word = o->line = o->orig = NULL;
-		    o->wlen = 0;
-		    free_cline(o->next);
-		    o->next = NULL;
-		    o->flags |= CLF_MISS;
+			o->word = o->line = o->orig = NULL;
+			o->wlen = 0;
+			free_cline(o->next);
+			o->next = NULL;
+			o->flags |= CLF_MISS;
+		    }
 		}
 	    }
 	    /* Ok, they are equal, now join the sub-lists. */