shell: fix parsing of $(( (v)++ + NUM ))

function                                             old     new   delta
evaluate_string                                      988    1011     +23

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-09-26 13:25:49 +02:00
parent 62e433131b
commit 1be73dd9ad
5 changed files with 44 additions and 22 deletions

View File

@ -2,4 +2,7 @@
1 1
1 1
1 1
6 6
7 7
7 7
Ok:0

View File

@ -2,4 +2,8 @@ echo 1 $((0++1))
echo 1 $((0--1))
x=-1; echo 1 $((0-$x))
x=+1; echo 1 $((0+$x))
a=3
echo 6 $((a+++3)) # a++ + 3
echo 7 $(((a)+++3)) # a + + + 3
echo 7 $(((a)+++3)) # a + + + 3
echo Ok:$?