Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: tricky.c bug fix(es)



With in-word completion and suffixes that caused the code to reduce it 
to an empty common suffix this could lead to a SEGV.
And with the matching stuff we have now and in-word completion, we
should do the fignore-test in addmatch() even if there is a suffix.

Bye
 Sven

--- os/Zle/zle_tricky.c	Tue Mar  9 14:50:32 1999
+++ Src/Zle/zle_tricky.c	Tue Mar  9 15:14:25 1999
@@ -2867,7 +2867,7 @@
 	o->suffix = join_new_sfx(o->suffix, n->wlen, n->word, &miss);
 	if (miss)
 	    o->flags |= CLF_MISS;
-    } else {
+    } else if (o->wlen && n->wlen) {
 	char so = o->word[o->wlen], sn = n->word[n->wlen];
 	char *new = o->word;
 	int newl = o->wlen, mol, mnl;
@@ -2893,7 +2893,8 @@
 
 	if (!o->suffix && n->wlen != o->wlen)
 	    o->flags |= CLF_MISS;
-    }
+    } else
+	o->wlen = 0;
 }
 
 /* Joins two Cline lists, building the most specific line string *
@@ -4417,7 +4418,8 @@
 	    return;
 
 	if ((addwhat == CC_FILES ||
-	     addwhat == -5) && !*psuf && !*fsuf) {
+	     addwhat == -5) && !*psuf) {
+	    //---- && !*fsuf) {
 	    /* If this is a filename, do the fignore check. */
 	    char **pt = fignore;
 	    int filell;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author