From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: :*<pat>:... patterns
Date: Tue, 4 Jan 2000 09:02:05 +0100 (MET) [thread overview]
Message-ID: <200001040802.JAA21727@beta.informatik.hu-berlin.de> (raw)
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
reply other threads:[~2000-01-04 8:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200001040802.JAA21727@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).