From 76bd48d67422c28d54ef75ef313b8763f6d60760 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 17 Dec 2003 20:47:39 +0000 Subject: 19308: zsh crashes with $((##)) --- ChangeLog | 4 ++++ Src/utils.c | 5 ++++- Test/C01arith.ztst | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9047b8151..2e695e1c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-12-17 Oliver Kiddle + + * 19308: Src/utils.c, Test/C01arith.ztst: zsh crashes with $((##)) + 2003-12-16 Oliver Kiddle * 19299: Completion/Unix/Command/_mount: try to handle diff --git a/Src/utils.c b/Src/utils.c index 6b550a2cb..30519f247 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -3643,7 +3643,10 @@ getkeystring(char *s, int *len, int fromwhere, int *misc) } DPUTS(fromwhere == 4, "BUG: unterminated $' substitution"); *t = '\0'; - *len = t - buf; + if (fromwhere == 6) + *misc = 0; + else + *len = t - buf; return buf; } diff --git a/Test/C01arith.ztst b/Test/C01arith.ztst index 8558d66a8..d431daae0 100644 --- a/Test/C01arith.ztst +++ b/Test/C01arith.ztst @@ -68,6 +68,14 @@ 0:#, ## and $# >117 + print $((##)) +0:## without following character +>0 + + print $((## )) +0:## followed by a space +>32 + integer i (( i = 3 + 5 * 1.75 )) print $i -- cgit 1.4.1