summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-04-17 07:28:17 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-04-17 07:28:17 +0000
commitf78df94c6a547443c12641e2fc617b562ef0775c (patch)
tree935a6a55e00371daab33f91c85eafd2ac1b50211 /Src
parentb3e7ac2f75ab8581e426b7015ee24623be32bc3e (diff)
downloadzsh-f78df94c6a547443c12641e2fc617b562ef0775c.tar.gz
zsh-f78df94c6a547443c12641e2fc617b562ef0775c.tar.xz
zsh-f78df94c6a547443c12641e2fc617b562ef0775c.zip
make compvalues unquote the string from the line like comparguments does (16998)
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/computil.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index b5610fb77..a426a9a5b 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2768,6 +2768,23 @@ cv_get_val(Cvdef d, char *name)
     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 @@ cv_next(Cvdef d, char **sp, char **ap)
         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 @@ cv_next(Cvdef d, char **sp, char **ap)
             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 @@ cv_next(Cvdef d, char **sp, char **ap)
         } else
             *ap = sap = NULL;
 
-        r = cv_get_val(d, s);
+        r = cv_quote_get_val(d, s);
 
         if (sap)
             *sap = sav;