From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5839 invoked from network); 4 Jan 2000 08:03:12 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Jan 2000 08:03:12 -0000 Received: (qmail 10215 invoked by alias); 4 Jan 2000 08:02:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9187 Received: (qmail 10206 invoked from network); 4 Jan 2000 08:02:40 -0000 Date: Tue, 4 Jan 2000 09:02:05 +0100 (MET) Message-Id: <200001040802.JAA21727@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: :*:... patterns Happy new year... Such end-patterns in _arguments were ignored it seems (well, not really ignored, but it was broken in a way that made them be appear as if they were ignored). Bye Sven diff -u oldsrc/Zle/computil.c Src/Zle/computil.c --- oldsrc/Zle/computil.c Fri Dec 17 21:38:01 1999 +++ Src/Zle/computil.c Sun Dec 19 22:24:21 1999 @@ -709,9 +709,15 @@ p++; } else if (*p == '*') { if (*++p != ':') { - for (end = ++p; *p && *p != ':'; p++) + char sav; + + for (end = p++; *p && *p != ':'; p++) if (*p == '\\' && p[1]) p++; + sav = *p; + *p = '\0'; + end = dupstring(end); + *p = sav; } if (*p != ':') { freecadef(ret); @@ -735,6 +741,8 @@ /* And the definition. */ *oargp = parse_caarg(!rest, atype, oanum++, name, &p); + if (end) + (*oargp)->end = ztrdup(end); oargp = &((*oargp)->next); if (rest) break; @@ -1081,6 +1089,7 @@ if (state.def->end && pattry(endpat, line)) { state.def = NULL; state.curopt = NULL; + state.opt = state.arg = 1; continue; } } else if ((state.def = state.def->next)) @@ -1218,12 +1227,15 @@ for (; line; line = compwords[cur++]) addlinknode(l, ztrdup(line)); } LASTALLOC; - memcpy(&ca_laststate, &state, sizeof(state)); + if (cur < compcurrent) + memcpy(&ca_laststate, &state, sizeof(state)); ca_laststate.ddef = NULL; ca_laststate.doff = 0; break; } - } + } else if (state.def && state.def->end) + endpat = patcompile(state.def->end, 0, NULL); + /* Copy the state into the global one. */ if (cur + 1 == compcurrent) { -- Sven Wischnowsky wischnow@informatik.hu-berlin.de