summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2024-08-15 18:06:19 -0700
committerBart Schaefer <schaefer@zsh.org>2024-08-15 18:06:19 -0700
commit5977d3cdd4b241ab7afff868ed58afc00b45c424 (patch)
tree73507fbd28ac1bdf8383e502954e9380f454e55f
parent8a811b369b8c7338a90bb85e12bc9f0cfb2b6b6d (diff)
downloadzsh-5977d3cdd4b241ab7afff868ed58afc00b45c424.tar.gz
zsh-5977d3cdd4b241ab7afff868ed58afc00b45c424.zip
unposted: fix parsing of Bang token in value side of array element assignment
-rw-r--r--ChangeLog5
-rw-r--r--Src/lex.c3
-rw-r--r--Test/A06assign.ztst7
3 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ed2100f1..eec96a494 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-08-15 Bart Schaefer <schaefer@zsh.org>
+
+ * unposted (see 53034): Src/lex.c, Test/A06assign.ztst: fix parsing
+ of Bang token in value side of array element assignment
+
2024-08-13 Eric Cook <llua@gmx.com>
* 53031: Christian Heusel: Completion/Unix/Command/_git: add
diff --git a/Src/lex.c b/Src/lex.c
index 700af2da1..efbb62b66 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1402,10 +1402,11 @@ gettokstr(int c, int sub)
/*
* Same logic as Dash, for ! to perform negation in range.
*/
- if (seen_brct)
+ if (seen_brct && brct)
c = Bang;
else
c = '!';
+ break;
case LX2_OTHER:
if (in_brace_param) {
if (c == '/') {
diff --git a/Test/A06assign.ztst b/Test/A06assign.ztst
index 3eff5331a..9f779b9a8 100644
--- a/Test/A06assign.ztst
+++ b/Test/A06assign.ztst
@@ -743,3 +743,10 @@
print $a
0:overwrite [2] character (string: "") with "xx"
>xx
+
+ ( sleep 1 &
+ x[1]=$!
+ typeset -p x
+ )
+0:regression workers/53033: assigning $! to array element
+*>typeset -g -a x=\( <-> \)