Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: _values does not quote inserted matches
- X-seq: zsh-workers 16998
- From: Sven Wischnowsky <wischnow@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: Re: _values does not quote inserted matches
- Date: Wed, 17 Apr 2002 09:26:30 +0200
- In-reply-to: <1020416160723.ZM10203@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <002a01c1e52e$9a40aa30$1fc1f2a3@xxxxxxxxxxxxxx> <1020416160723.ZM10203@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> ...
>
> The problem doesn't seem to be with _values, per se ... it's either in the
> `compvalues' C function, or somewhere down below _describe.
Right. The former. And it's weird that I forgot it there, because it
did it for comparguments. Hm. Anyaway. The patch below copies the
appropriate piece of code from comparguments to compvalues.
I'll also apply this to 4.0.
Bye
Sven
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.76
diff -u -r1.76 computil.c
--- Src/Zle/computil.c 18 Feb 2002 14:36:02 -0000 1.76
+++ Src/Zle/computil.c 17 Apr 2002 07:25:12 -0000
@@ -2768,6 +2768,23 @@
return NULL;
}
+static Cvval
+cv_quote_get_val(Cvdef d, char *name)
+{
+ int ne;
+
+ /* remove quotes */
+ name = dupstring(name);
+ ne = noerrs;
+ noerrs = 2;
+ parse_subst_string(name);
+ noerrs = ne;
+ remnulargs(name);
+ untokenize(name);
+
+ return cv_get_val(d, name);
+}
+
/* Handle a xor list. */
static void
@@ -2820,7 +2837,7 @@
do {
sav = *++s;
*s = '\0';
- if ((r = cv_get_val(d, v))) {
+ if ((r = cv_quote_get_val(d, v))) {
*s = sav;
break;
@@ -2864,7 +2881,7 @@
sav = *sap;
*sap = '\0';
}
- if ((!(r = cv_get_val(d, s)) || r->type == CVV_NOARG) && skip)
+ if ((!(r = cv_quote_get_val(d, s)) || r->type == CVV_NOARG) && skip)
ns = as;
if (sap)
@@ -2886,7 +2903,7 @@
} else
*ap = sap = NULL;
- r = cv_get_val(d, s);
+ r = cv_quote_get_val(d, s);
if (sap)
*sap = sav;
--
Sven Wischnowsky wischnow@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author