* PATCH: _arguments with multiple sets
@ 2002-01-08 15:26 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2002-01-08 15:26 UTC (permalink / raw)
To: zsh-workers
Oliver pointed out to me that completion after `compdef -' was buggy
because the `-a' and `-n' options were listed multiple times. That's
a result of _compdef using _arguments with multiple sets and the
C-code not removing multple identical specs reported back to the shell
code. Here's a patch for that.
Bye
Sven
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.73
diff -u -r1.73 computil.c
--- Src/Zle/computil.c 2001/08/08 07:44:00 1.73
+++ Src/Zle/computil.c 2002/01/08 15:26:04
@@ -2315,6 +2315,7 @@
LinkList direct = newlinklist();
LinkList odirect = newlinklist();
LinkList equal = newlinklist(), l;
+ LinkNode node;
Caopt p;
char *str;
int ret = 1;
@@ -2349,7 +2350,13 @@
strcat(str, p->descr);
} else
str = bslashcolon(p->name);
- addlinknode(l, str);
+
+ for (node = firstnode(l); node; incnode(node))
+ if (!strcmp(str, (char *) getdata(node)))
+ break;
+
+ if (!node)
+ addlinknode(l, str);
}
}
}
--
Sven Wischnowsky wischnow@berkom.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-01-08 15:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-08 15:26 PATCH: _arguments with multiple sets Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).