* PATCH: :*<pat>:... patterns
@ 2000-01-04 8:02 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-01-04 8:02 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-01-04 8:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-04 8:02 PATCH: :*<pat>:... patterns Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).