summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-04-03 10:03:13 +0100
committerPeter Stephenson <pws@zsh.org>2017-04-03 10:04:03 +0100
commitf6ab9a281dde719e180809db52d0d142d0c0a240 (patch)
tree905c26346e1137c14f6535739aad608aa81131d3 /Test
parent207263a61e54a413d02c52f08d7771dd082d20f1 (diff)
downloadzsh-f6ab9a281dde719e180809db52d0d142d0c0a240.tar.gz
zsh-f6ab9a281dde719e180809db52d0d142d0c0a240.tar.xz
zsh-f6ab9a281dde719e180809db52d0d142d0c0a240.zip
40932: Parameter subscripts need to count parentheses.
Otherwise they can terminate in the middle of an expression.
Diffstat (limited to 'Test')
-rw-r--r--Test/D06subscript.ztst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Test/D06subscript.ztst b/Test/D06subscript.ztst
index 144923667..f0a858b1c 100644
--- a/Test/D06subscript.ztst
+++ b/Test/D06subscript.ztst
@@ -266,3 +266,10 @@
 >of the gang
 >of the gang
 >of the gang
+
+ string='abcde'
+ twoarg() { return $(( $2 - $1 )) }
+ functions -M twoarg
+ print ${string[1,twoarg(1,4)]}
+0:Commas inside parentheses do not confuse subscripts
+>abc