summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/subst.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c3b37fba..c23237baa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2012-04-22 Peter Stephenson <p.w.stephenson@ntlworld.com>
+ * unposted: Src/subst.c: add test for valid identifier to 30431.
+
* Test/D04parameter.ztst: 30439: Src/subst.c,
Test/D04parameter.ztst: ${...:*...} with nonexistent or
non-array variable second should return no results.
@@ -16235,5 +16237,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5638 $
+* $Revision: 1.5639 $
*****************************************************
diff --git a/Src/subst.c b/Src/subst.c
index 079d9efde..932f41287 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2879,7 +2879,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
} else if (inbrace && (*s == '|' || *s == Bar ||
*s == '*' || *s == Star)) {
int intersect = (*s == '*' || *s == Star);
- char **compare = getaparam(++s), **ap, **apsrc;
+ char **compare, **ap, **apsrc;
+ ++s;
+ if (*itype_end(s, IIDENT, 0)) {
+ untokenize(s);
+ zerr("not an identifier: %s", s);
+ return NULL;
+ }
+ compare = getaparam(s);
if (compare) {
HashTable ht = newuniqtable(arrlen(compare)+1);
int present;