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

PATCH: Re: Bug in 3.1.9: REC_EXACT does not work with commands



Christoph Lange wrote:

>   when the REC_EXACT option is set in zsh-3.1.9, it does not work with
> command names. Here is how it should be (and how it works in zsh-3.0.8):
> 
> % setopt recexact
> % cp[Tab]
> % cp _
> 
> Instead, zsh-3.1.9 ignores the option:
> 
> % setopt recexact
> % cp[Tab]
> cp	cpio	cpp

Oops. The problem was that there are two `cp's. When finding the
second one it thought that this isn't an exact match -- which is
correct, but only if the two (or more) produce different strings on
the line, e.g. because of prefixes/suffixes. So we have to make it
test that.

Bye
 Sven

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.36
diff -u -r1.36 compcore.c
--- Src/Zle/compcore.c	2000/07/04 15:04:17	1.36
+++ Src/Zle/compcore.c	2000/07/18 08:34:36
@@ -2397,7 +2397,7 @@
 		comp_setunset(0, 0, CP_EXACTSTR, 0);
 	    }
 	    ai->exactm = cm;
-	} else if (useexact) {
+	} else if (useexact && !matcheq(cm, ai->exactm)) {
 	    ai->exact = 2;
 	    ai->exactm = NULL;
 	    if (incompfunc)

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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