summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/computil.c23
2 files changed, 25 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e42286121..57a76186d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-17  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 16998: Src/Zle/computil.c: make compvalues unquote the string
+	from the line like comparguments does
+
 2002-04-16  Felix Rosencrantz <f_rosencrantz@yahoo.com>
 
 	* 16956: Completion/Unix/Command/_java: Changed to use
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;