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

PATCH: unambiguous string insertion



While playing with _multi_parts some more I noticed that it inserted
unambiguous strings such as `.' or `..'. This patch avoids silly
things like these again.

Bye
 Sven

diff -ru ../z.old/Src/Zle/compresult.c Src/Zle/compresult.c
--- ../z.old/Src/Zle/compresult.c	Thu Feb 17 12:57:50 2000
+++ Src/Zle/compresult.c	Thu Feb 17 13:30:04 2000
@@ -64,7 +64,8 @@
 	    q = p;
     }
     if (!e && q && !q->orig && !q->olen && (q->flags & CLF_MISS) &&
-	!(q->flags & CLF_MATCHED) && (q->word ? q->wlen : q->llen) < 3) {
+	(!(q->flags & CLF_MATCHED) || (!q->prefix && !q->suffix)) &&
+	(q->word ? q->wlen : q->llen) < 3) {
 	q->word = q->line = NULL;
 	q->wlen = q->llen = 0;
     }

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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