From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8102 invoked from network); 18 Oct 1999 08:56:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Oct 1999 08:56:27 -0000 Received: (qmail 17022 invoked by alias); 18 Oct 1999 08:56:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8315 Received: (qmail 17013 invoked from network); 18 Oct 1999 08:56:18 -0000 Date: Mon, 18 Oct 1999 10:56:12 +0200 (MET DST) Message-Id: <199910180856.KAA26365@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Fri, 15 Oct 1999 19:06:35 +0400 Subject: Re: Problems with _arguments Andrej Borsenkow wrote: > This little completion stopped to work. I suspect new computil module ... Yep. The main problem was that I forgot to save the parsing state in with restricting rest-argument-definitions. Bye Sven diff -u oldsrc/Zle/computil.c Src/Zle/computil.c --- oldsrc/Zle/computil.c Mon Oct 18 10:38:44 1999 +++ Src/Zle/computil.c Mon Oct 18 10:53:48 1999 @@ -1043,24 +1043,28 @@ if (!state.def) state.curopt = NULL; } else if (state.arg) { - PERMALLOC { - addlinknode(state.args, ztrdup(line)); - } LASTALLOC; + if (state.inopt) { + state.inopt = 0; + state.nargbeg = cur - 1; + } if ((adef = state.def = ca_get_arg(d, state.nth)) && (state.def->type == CAA_RREST || state.def->type == CAA_RARGS)) { state.inrest = 0; + state.argbeg = cur; for (; line; line = compwords[cur++]) { PERMALLOC { addlinknode(state.args, ztrdup(line)); } LASTALLOC; } + memcpy(&ca_laststate, &state, sizeof(state)); + ca_laststate.ddef = NULL; + ca_laststate.doff = 0; break; } - if (state.inopt) { - state.inopt = 0; - state.nargbeg = cur - 1; - } + PERMALLOC { + addlinknode(state.args, ztrdup(line)); + } LASTALLOC; if (state.def && state.def->type != CAA_NORMAL && state.def->type != CAA_OPT && state.inarg) { state.restbeg = cur; @@ -1083,6 +1087,9 @@ addlinknode(l, line); } LASTALLOC; } + memcpy(&ca_laststate, &state, sizeof(state)); + ca_laststate.ddef = NULL; + ca_laststate.doff = 0; break; } } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de