about summary refs log tree commit diff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-04-17 07:29:29 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-04-17 07:29:29 +0000
commit6c839ee9fd094be7398f1deba85d185b8c7a4c05 (patch)
treeb4a2df970e4a7824161b840be41bedbc3bbe21b8 /Src/Zle/computil.c
parenta39613fdc91dfd91f73101335a3432f0325aa100 (diff)
downloadzsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar.gz
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar.xz
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.zip
16998: make compvalues unquote the string from the line like comparguments does
Diffstat (limited to 'Src/Zle/computil.c')
-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 155c883f6..fed165561 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2319,6 +2319,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
@@ -2371,7 +2388,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;
@@ -2415,7 +2432,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)
@@ -2437,7 +2454,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;