From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8842 invoked from network); 26 Feb 1999 15:28:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Feb 1999 15:28:50 -0000 Received: (qmail 10574 invoked by alias); 26 Feb 1999 15:28:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5547 Received: (qmail 10567 invoked from network); 26 Feb 1999 15:28:30 -0000 Date: Fri, 26 Feb 1999 16:27:43 +0100 (MET) Message-Id: <199902261527.QAA32151@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: compadd and -J/-V Since I was testing compadd anyway... The group handling wasn't fully working yet, the list into which the matches were stored was selected too early. And the group name wasn't copied but could have been freed before used again. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Fri Feb 26 12:50:50 1999 +++ Src/Zle/zle_tricky.c Fri Feb 26 16:05:50 1999 @@ -3916,14 +3916,6 @@ struct cmlist mst; Cmlist oms = mstack; - /* Select the set of matches. */ - if (aflags & CAF_ALT) { - l = fmatches; - ai = fainfo; - } else { - l = matches; - ai = ainfo; - } /* Use menu-completion (-U)? */ if ((aflags & CAF_MENU) && isset(AUTOMENU)) usemenu = 1; @@ -3989,6 +3988,17 @@ begcmgroup(group, (aflags & CAF_NOSORT)); if (aflags & CAF_NOSORT) mgroup->flags |= CGF_NOSORT; + } else { + endcmgroup(NULL); + begcmgroup("default", 0); + } + /* Select the set of matches. */ + if (aflags & CAF_ALT) { + l = fmatches; + ai = fainfo; + } else { + l = matches; + ai = ainfo; } if (remf) { remf = dupstring(remf); @@ -6782,7 +6796,7 @@ } } mgroup = (Cmgroup) halloc(sizeof(struct cmgroup)); - mgroup->name = n; + mgroup->name = dupstring(n); mgroup->flags = mgroup->lcount = mgroup->mcount = 0; mgroup->matches = NULL; mgroup->ylist = NULL; -- Sven Wischnowsky wischnow@informatik.hu-berlin.de