zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: PATCH: Re: _values does not quote inserted matches
Date: Wed, 17 Apr 2002 09:26:30 +0200	[thread overview]
Message-ID: <15549.9126.268541.310341@wischnow.berkom.de> (raw)
In-Reply-To: <1020416160723.ZM10203@candle.brasslantern.com>


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


  reply	other threads:[~2002-04-17  7:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-13 20:38 Borsenkow Andrej
2002-04-13 23:26 ` Bart Schaefer
2002-04-16  6:11   ` Borsenkow Andrej
2002-04-16  7:54   ` Sven Wischnowsky
2002-04-16 10:08     ` Borsenkow Andrej
2002-04-16 16:07       ` Bart Schaefer
2002-04-17  7:26         ` Sven Wischnowsky [this message]
2002-04-19  8:37         ` Borsenkow Andrej
2002-04-19 16:54           ` Bart Schaefer
2002-04-23  9:45             ` Oliver Kiddle
2002-04-24  7:37               ` Sven Wischnowsky
2002-05-06  7:04               ` PATCH: _urpmi update Borsenkow Andrej

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=15549.9126.268541.310341@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --cc=zsh-workers@sunsite.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).