about summary refs log tree commit diff
path: root/Src/Zle/zle_tricky.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_tricky.c')
-rw-r--r--Src/Zle/zle_tricky.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 2984b836f..43cb2fe9f 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -7192,8 +7192,19 @@ static int
 matchcmp(Cmatch *a, Cmatch *b)
 {
     if ((*a)->disp) {
-	if ((*b)->disp)
-	    return strcmp((*a)->disp, (*b)->disp);
+	if ((*b)->disp) {
+	    if ((*a)->flags & CMF_DISPLINE) {
+		if ((*b)->flags & CMF_DISPLINE)
+		    return strcmp((*a)->disp, (*b)->disp);
+		else
+		    return -1;
+	    } else {
+		if ((*b)->flags & CMF_DISPLINE)
+		    return 1;
+		else
+		    return strcmp((*a)->disp, (*b)->disp);
+	    }
+	}
 	return -1;
     }
     if ((*b)->disp)
@@ -7264,7 +7275,7 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp)
 	    qsort((void *) rp, n, sizeof(Cmatch),
 		  (int (*) _((const void *, const void *)))matchcmp);
 
-	    if (!(flags & (CGF_UNIQALL | CGF_UNIQCON))) {
+	    if (!(flags & CGF_UNIQCON)) {
 		/* And delete the ones that occur more than once. */
 		for (ap = cp = rp; *ap; ap++) {
 		    *cp++ = *ap;