From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16101 invoked from network); 21 Oct 1999 10:31:56 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Oct 1999 10:31:56 -0000 Received: (qmail 3842 invoked by alias); 21 Oct 1999 10:31:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8357 Received: (qmail 3835 invoked from network); 21 Oct 1999 10:31:43 -0000 Date: Thu, 21 Oct 1999 12:31:34 +0200 (MET DST) Message-Id: <199910211031.MAA04855@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 21 Oct 1999 18:05:48 +0900 Subject: Re: PATCH: _archie Tanaka Akira wrote: > Z(2):akr@is27e1u11% Src/zsh -f > is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst > is27e1u11% compconf group_matches=yes message_format='%d' description_format='%d' > is27e1u11% compconf describe_options=yes describe_values=yes option_prefix=yes > > (1) archie -N > flex -C has same problem. > (2) bison -b > (3) bison -vV > (4) cvs - Aargh! Sorry. Bye Sven diff -u oldsrc/Zle/computil.c Src/Zle/computil.c --- oldsrc/Zle/computil.c Thu Oct 21 10:33:09 1999 +++ Src/Zle/computil.c Thu Oct 21 12:28:22 1999 @@ -863,8 +863,6 @@ } else if (!p || !p->active || (line[1] && p->args) || p->name[0] != pre) return NULL; - else - p = NULL; if (p && end) *end = line; return p; @@ -973,7 +971,7 @@ addlinknode(state.oargs[state.curopt->num], ztrdup(line)); } LASTALLOC; } - state.opt = (state.def->type == CAA_OPT && line[0] && line[1]); + state.opt = (state.def->type == CAA_OPT); if (state.def->type == CAA_REST || state.def->type == CAA_RARGS || state.def->type == CAA_RREST) { @@ -984,13 +982,17 @@ } } else if ((state.def = state.def->next)) state.argbeg = cur; - else + else { state.curopt = NULL; + state.opt = 1; + } } else { - state.opt = (line[0] ? (line[1] ? 2 : 1) : 0); - state.arg = 1; + state.opt = state.arg = 1; state.curopt = NULL; } + if (state.opt) + state.opt = (line[0] ? (line[1] ? 2 : 1) : 0); + pe = NULL; if (state.opt == 2 && (state.curopt = ca_get_opt(d, line, 0, &pe))) { @@ -1018,7 +1020,9 @@ addlinknode(state.oargs[state.curopt->num], ztrdup(pe)); } LASTALLOC; } - if (!state.def) + if (state.def) + state.opt = 0; + else state.curopt = NULL; } else if (state.opt == 2 && d->single && (state.curopt = ca_get_sopt(d, line, 0, &pe))) { @@ -1051,7 +1055,9 @@ addlinknode(state.oargs[state.curopt->num], ztrdup(pe)); } LASTALLOC; } - if (!state.def) + if (state.def) + state.opt = 0; + else state.curopt = NULL; } else if (state.arg) { if (state.inopt) { @@ -1062,7 +1068,7 @@ (state.def->type == CAA_RREST || state.def->type == CAA_RARGS)) { state.inrest = 0; - state.opt = 0; + state.opt = (cur == state.nargbeg + 1); state.optbeg = state.nargbeg; state.argbeg = cur - 1; @@ -1111,9 +1117,10 @@ ca_laststate.ddef = NULL; ca_laststate.doff = 0; } else if (cur == compcurrent && !ca_laststate.def) { - if ((ca_laststate.def = ddef)) + if ((ca_laststate.def = ddef)) { ca_laststate.doff = doff; - else { + ca_laststate.opt = 0; + } else { ca_laststate.def = adef; ca_laststate.ddef = NULL; ca_laststate.optbeg = state.nargbeg; -- Sven Wischnowsky wischnow@informatik.hu-berlin.de