about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-09 09:50:12 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-10-09 09:50:12 +0000
commitdc472db5f064afb1607617f5dc2b38b5e40b5923 (patch)
tree3920fa1b7fba6c5ccf601558d5bb319438c5fc8b
parentbc0f49e09be219328a3bec876172931b4e962ecd (diff)
downloadzsh-dc472db5f064afb1607617f5dc2b38b5e40b5923.tar.gz
zsh-dc472db5f064afb1607617f5dc2b38b5e40b5923.tar.xz
zsh-dc472db5f064afb1607617f5dc2b38b5e40b5923.zip
hide all but one match with the same string in the list even for unsorted groups (15991)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/compcore.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 52c65318d..ce4d5be92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-09  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 15991: Src/Zle/compcore.c: hide all but one match with the
+	same string in the list even for unsorted groups
+
 2001-10-08  Oliver Kiddle  <opk@zsh.org>
 
 	* 15987: Src/Modules/tcp.c: remove includes duplicated from tcp.h
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index d3f720478..8127fcd5d 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -2654,6 +2654,8 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp)
 	    }
 	} else {
 	    if (!(flags & CGF_UNIQALL) && !(flags & CGF_UNIQCON)) {
+                int dup;
+
 		for (ap = rp; *ap; ap++) {
 		    for (bp = cp = ap + 1; *bp; bp++) {
 			if (!matcheq(*ap, *bp))
@@ -2662,6 +2664,17 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp)
 			    n--;
 		    }
 		    *cp = NULL;
+                    if (!(*ap)->disp) {
+                        for (dup = 0, bp = ap + 1; *bp; bp++)
+                            if (!(*bp)->disp &&
+                                !((*bp)->flags & CMF_MULT) &&
+                                !strcmp((*ap)->str, (*bp)->str)) {
+                                (*bp)->flags |= CMF_MULT;
+                                dup = 1;
+                            }
+                        if (dup)
+                            (*ap)->flags |= CMF_FMULT;
+                    }
 		}
 	    } else if (!(flags & CGF_UNIQCON)) {
 		int dup;