summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2015-11-11 22:14:16 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2015-11-11 22:14:16 +0000
commit7a951ef93ef2cc6baac9ec3b51909ad44e4bfe15 (patch)
tree995acd45740444f3a14801d2c8b057225aa1826c /Src/subst.c
parent830d54e629e8e12eb5a219a65a013876662e7b3e (diff)
downloadzsh-7a951ef93ef2cc6baac9ec3b51909ad44e4bfe15.tar.gz
zsh-7a951ef93ef2cc6baac9ec3b51909ad44e4bfe15.tar.xz
zsh-7a951ef93ef2cc6baac9ec3b51909ad44e4bfe15.zip
37094: Further tweaks to parameter name references.
Safety in array test.

Make nested references work.

Add parameter tests.
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/subst.c b/Src/subst.c
index f3a4ad44d..c1369b5a7 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2315,7 +2315,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 	     * substitution.
 	     */
 	    if (isarr) {
-		if (aval[1]) {
+		if (aval[0] && aval[1]) {
 		    zerr("parameter name reference used with array");
 		    return NULL;
 		}
@@ -2324,7 +2324,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 	    }
 	    s = dyncat(val, s);
 	    /* Now behave po-faced as if it was always like that... */
-	    subexp = aspar = 0;
+	    subexp = 0;
 	}
 	v = (Value) NULL;
     } else if (aspar) {
@@ -2360,7 +2360,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
      * far has just yielded us a parameter name to be processed
      * with (P).
      */
-    else if (!subexp || aspar) {
+    if (!subexp || aspar) {
 	char *ov = val;
 
 	/*