From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28047 invoked from network); 16 Jun 1999 06:37:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Jun 1999 06:37:43 -0000 Received: (qmail 19156 invoked by alias); 16 Jun 1999 06:37:27 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6649 Received: (qmail 19149 invoked from network); 16 Jun 1999 06:37:25 -0000 Date: Wed, 16 Jun 1999 08:37:24 +0200 (MET DST) Message-Id: <199906160637.IAA05062@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 16 Jun 1999 01:45:40 +0900 Subject: Re: compctl -l with non-empty argument. Tanaka Akira wrote: > After above operation, compctl -L print follows. > > is27e1u11% compctl -L > compctl -k '(a b c)' aaa > compctl -l bbb bbb > compctl -C -c -tn > compctl -D -f -tn > compctl -T > > Hmm. Argument for -l is replaced... Hm, I can't reproduce this. Could you try the patch below and tell us if it works? Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Wed Jun 16 08:22:35 1999 +++ Src/Zle/zle_tricky.c Wed Jun 16 08:31:46 1999 @@ -6507,7 +6507,7 @@ if (cc->subcmd) { /* Handle -l sub-completion. */ char **ow = clwords, *os = cmdstr, *ops = NULL; - int oldn = clwnum, oldp = clwpos; + int oldn = clwnum, oldp = clwpos, br; unsigned long occ = ccont; ccont = CC_CCCONT; @@ -6523,21 +6523,22 @@ erange = 1; clwnum = erange - brange + 1; clwpos = clwpos - brange; - + br = brange; + if (cc->subcmd[0]) { /* And probably put the command name given to the flag * * in the array. */ clwpos++; clwnum++; incmd = 0; - ops = clwords[brange - 1]; - clwords[brange - 1] = cc->subcmd; + ops = clwords[br - 1]; + clwords[br - 1] = ztrdup(cc->subcmd); cmdstr = ztrdup(cc->subcmd); - clwords += brange - 1; + clwords += br - 1; } else { - cmdstr = ztrdup(clwords[brange]); + cmdstr = ztrdup(clwords[br]); incmd = !clwpos; - clwords += brange; + clwords += br; } /* Produce the matches. */ makecomplistcmd(s, incmd, CFN_FIRST); @@ -6548,8 +6549,10 @@ cmdstr = os; clwnum = oldn; clwpos = oldp; - if (ops) - clwords[brange - 1] = ops; + if (ops) { + zsfree(clwords[br - 1]); + clwords[br - 1] = ops; + } ccont = occ; } if (cc->substr) -- Sven Wischnowsky wischnow@informatik.hu-berlin.de