From bdecf74ef12452e2123ce66e42bc66aa81347b30 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 22 Sep 1999 22:32:20 +0000 Subject: zsh-workers/8004 --- Src/Zle/zle_tricky.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Src/Zle/zle_tricky.c') 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; -- cgit 1.4.1