summaryrefslogtreecommitdiffstats
path: root/Src
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
parentusers/4836: make _path_files use match specs from the matcher style when call... (diff)
downloadzsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar.gz
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar.bz2
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar.lz
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar.xz
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.tar.zst
zsh-6c839ee9fd094be7398f1deba85d185b8c7a4c05.zip
16998: make compvalues unquote the string from the line like comparguments does
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 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;