From fa509f5219e18b664a7e559169d849b2ec9fb6f1 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 18 Feb 2002 14:30:46 +0000 Subject: fix group handling nothing should now possibly be added to the wrong group again (16668) --- ChangeLog | 3 +++ Src/Zle/compcore.c | 46 +++++++++++++++++++--------------------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index c23d27729..f890b788d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2002-02-18 Sven Wischnowsky + * 16668: Src/Zle/compcore.c: fix group handling nothing should + now possibly be added to the wrong group again + * 16667: Completion/Base/Utility/_arguments: fix test for prefix-needed diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 748a01f6c..21ea681bb 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -1619,6 +1619,21 @@ addmatches(Cadata dat, char **argv) Heap oldheap; SWITCHHEAPS(oldheap, compheap) { + if (dat->dummies) + dat->aflags = ((dat->aflags | CAF_NOSORT | CAF_UNIQCON) & + ~CAF_UNIQALL); + + /* Select the group in which to store the matches. */ + gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT : 0) | + ((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) | + ((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0)); + if (dat->group) { + endcmgroup(NULL); + begcmgroup(dat->group, gflags); + } else { + endcmgroup(NULL); + begcmgroup("default", 0); + } if (dat->mesg || dat->exp) { curexpl = (Cexpl) zhalloc(sizeof(struct cexpl)); curexpl->always = !!dat->mesg; @@ -1630,25 +1645,13 @@ addmatches(Cadata dat, char **argv) curexpl = NULL; } SWITCHBACKHEAPS(oldheap); - if (!*argv && !dat->dummies && !(dat->aflags & CAF_ALL)) { - SWITCHHEAPS(oldheap, compheap) { - /* Select the group in which to store the matches. */ - gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT : 0) | - ((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) | - ((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0)); - if (dat->group) { - endcmgroup(NULL); - begcmgroup(dat->group, gflags); - } else { - endcmgroup(NULL); - begcmgroup("default", 0); - } - } SWITCHBACKHEAPS(oldheap); - + if (!*argv && !dat->dummies && !(dat->aflags & CAF_ALL)) return 1; - } + +#if 0 if (dat->dummies) dat->aflags = (dat->aflags | CAF_NOSORT | CAF_UNIQCON) & ~CAF_UNIQALL; +#endif for (bp = brbeg; bp; bp = bp->next) bp->curpos = ((dat->aflags & CAF_QUOTE) ? bp->pos : bp->qpos); for (bp = brend; bp; bp = bp->next) @@ -1881,17 +1884,6 @@ addmatches(Cadata dat, char **argv) } } } - /* Select the group in which to store the matches. */ - gflags = (((dat->aflags & CAF_NOSORT ) ? CGF_NOSORT : 0) | - ((dat->aflags & CAF_UNIQALL) ? CGF_UNIQALL : 0) | - ((dat->aflags & CAF_UNIQCON) ? CGF_UNIQCON : 0)); - if (dat->group) { - endcmgroup(NULL); - begcmgroup(dat->group, gflags); - } else { - endcmgroup(NULL); - begcmgroup("default", 0); - } if (*argv) { if (dat->pre) dat->pre = dupstring(dat->pre); -- cgit 1.4.1