From cb4ff5e9703d6641b10ca053f1caad2a8b19d2f9 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 22 Apr 2012 18:39:53 +0000 Subject: 30439: ${...:*...} with nonexistent or non-array after * should return no results --- Src/subst.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Src/subst.c') 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. */ /* -- cgit 1.4.1