summaryrefslogtreecommitdiff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-04-22 18:39:53 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-04-22 18:39:53 +0000
commitcb4ff5e9703d6641b10ca053f1caad2a8b19d2f9 (patch)
tree0aa468fc42c6d92b6bf120af91a66af87651077f /Src/subst.c
parent5eb53bf88d3153510f0a5304e921b46419fe5721 (diff)
downloadzsh-cb4ff5e9703d6641b10ca053f1caad2a8b19d2f9.tar.gz
zsh-cb4ff5e9703d6641b10ca053f1caad2a8b19d2f9.zip
30439: ${...:*...} with nonexistent or non-array after *
should return no results
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 82645ccfa..079d9efde 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2918,6 +2918,19 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
}
}
deletehashtable(ht);
+ } else if (intersect) {
+ /*
+ * The intersection with nothing is nothing...
+ * Seems a bit pointless complaining that the first
+ * expression is unset here if the second is, too.
+ */
+ if (!vunset) {
+ if (isarr) {
+ aval = mkarray(NULL);
+ } else {
+ val = dupstring("");
+ }
+ }
}
} else { /* no ${...=...} or anything, but possible modifiers. */
/*