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

PATCH: Re: _arguments -+o



Tanaka Akira wrote:

> serein% bindkey -e; autoload -U compinit; compinit -D
> serein% _tst () { _arguments -+o }
> serein% tst +o <TAB>
> ->
> serein% tst +o +o
> 
> +o is completed more than once.

Oops. The xor list wasn't set up correctly.

Bye
 Sven

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.6
diff -u -r1.6 computil.c
--- Src/Zle/computil.c	2000/04/17 08:04:42	1.6
+++ Src/Zle/computil.c	2000/04/17 08:48:17
@@ -623,7 +623,7 @@
 		 * stuff twice for such things. */
 		name = ++p;
 		*p = (again ? '-' : '+');
-		again = 1 - again;
+		again++;
 	    } else {
 		name = p;
 		/* If it's a long option skip over the first `-'. */
@@ -767,7 +767,7 @@
 		    opt->descr = NULL;
 	    } else
 		opt->descr = NULL;
-	    opt->xor = xor;
+	    opt->xor = (again == 1 ? zarrdup(xor) : xor);
 	    opt->type = otype;
 	    opt->args = oargs;
 	    opt->num = nopts++;
@@ -783,7 +783,7 @@
 	    if (single && name[1] && !name[2])
 		ret->single[STOUC(name[1])] = opt;
 
-	    if (again) {
+	    if (again == 1) {
 		/* Do it all again for `*-...'. */
 		p = dupstring(*args);
 		goto rec;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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