From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13170 invoked from network); 17 Apr 2002 07:27:30 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 17 Apr 2002 07:27:30 -0000 Received: (qmail 9745 invoked by alias); 17 Apr 2002 07:27:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16998 Received: (qmail 9734 invoked from network); 17 Apr 2002 07:27:19 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15549.9126.268541.310341@wischnow.berkom.de> Date: Wed, 17 Apr 2002 09:26:30 +0200 To: zsh-workers@sunsite.dk Subject: PATCH: Re: _values does not quote inserted matches In-Reply-To: <1020416160723.ZM10203@candle.brasslantern.com> References: <002a01c1e52e$9a40aa30$1fc1f2a3@mow.siemens.ru> <1020416160723.ZM10203@candle.brasslantern.com> X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid 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@berkom.de