summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-arith/arith.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2021-09-25 22:04:45 +0200
committerDenys Vlasenko2021-09-25 22:04:45 +0200
commitd84a604830a7ee3f8fb5f3908ae0d54513393a20 (patch)
tree3e9dc05e082e41328a84c8eaa3d45f36c2ba5d44 /shell/hush_test/hush-arith/arith.tests
parent627821e42b06adfe6bbc6004d8eeb7c35f65120d (diff)
downloadbusybox-d84a604830a7ee3f8fb5f3908ae0d54513393a20.zip
busybox-d84a604830a7ee3f8fb5f3908ae0d54513393a20.tar.gz
shell: fix arithmentic evaluation of "++7" and such (it is + + 7, i.e. 7)
function old new delta evaluate_string 945 988 +43 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-arith/arith.tests')
-rwxr-xr-xshell/hush_test/hush-arith/arith.tests10
1 files changed, 5 insertions, 5 deletions
diff --git a/shell/hush_test/hush-arith/arith.tests b/shell/hush_test/hush-arith/arith.tests
index bc6b341..a7aded1 100755
--- a/shell/hush_test/hush-arith/arith.tests
+++ b/shell/hush_test/hush-arith/arith.tests
@@ -255,8 +255,8 @@ echo 3 $x
echo 4 $(( ++x ))
echo 4 $x
-# bash 3.2 apparently thinks that ++7 is 7
-#ash# echo 7 $(( ++7 ))
+# ++ is not a inc operator on non-variable, it is the + + sequence
+echo 7 $(( ++7 ))
( echo $(( 7-- )) )
( echo $(( --x=7 )) )
@@ -270,9 +270,9 @@ echo 4 $x
echo 7 $(( +7 ))
echo -7 $(( -7 ))
-# bash 3.2 apparently thinks that ++7 is 7
-#ash# echo $(( ++7 ))
-#ash# echo $(( --7 ))
+# ++ is not a inc operator on non-variable, it is the + + sequence
+echo $(( ++7 ))
+echo $(( --7 ))
${THIS_SH} ./arith1.sub
${THIS_SH} ./arith2.sub