diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-05-25 14:22:10 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-05-25 14:22:10 +0200 |
commit | 6824298ab4d3da40763af4d2d466a72745b8b593 (patch) | |
tree | 13382dd9610b5154e79ad971f17f1dc54f13ea1a /shell/ash_test/ash-misc | |
parent | 3e83699ce23400d75c7ddaa7ebfdec015177caa7 (diff) | |
download | busybox-w32-6824298ab4d3da40763af4d2d466a72745b8b593.tar.gz busybox-w32-6824298ab4d3da40763af4d2d466a72745b8b593.tar.bz2 busybox-w32-6824298ab4d3da40763af4d2d466a72745b8b593.zip |
hush: fix ELIF cmd1;cmd2 THEN ... not executing cmd2, closes 15571
function old new delta
run_list 1012 1024 +12
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-misc')
-rw-r--r-- | shell/ash_test/ash-misc/elif1.right | 4 | ||||
-rwxr-xr-x | shell/ash_test/ash-misc/elif1.tests | 6 | ||||
-rw-r--r-- | shell/ash_test/ash-misc/elif2.right | 2 | ||||
-rwxr-xr-x | shell/ash_test/ash-misc/elif2.tests | 8 |
4 files changed, 20 insertions, 0 deletions
diff --git a/shell/ash_test/ash-misc/elif1.right b/shell/ash_test/ash-misc/elif1.right new file mode 100644 index 000000000..36dc59fed --- /dev/null +++ b/shell/ash_test/ash-misc/elif1.right | |||
@@ -0,0 +1,4 @@ | |||
1 | ELIF1 | ||
2 | ELIF2 | ||
3 | ELIF THEN | ||
4 | Ok:0 | ||
diff --git a/shell/ash_test/ash-misc/elif1.tests b/shell/ash_test/ash-misc/elif1.tests new file mode 100755 index 000000000..77b8a25ea --- /dev/null +++ b/shell/ash_test/ash-misc/elif1.tests | |||
@@ -0,0 +1,6 @@ | |||
1 | if false; then | ||
2 | : | ||
3 | elif echo 'ELIF1'; echo 'ELIF2'; then | ||
4 | echo "ELIF THEN" | ||
5 | fi | ||
6 | echo "Ok:$?" | ||
diff --git a/shell/ash_test/ash-misc/elif2.right b/shell/ash_test/ash-misc/elif2.right new file mode 100644 index 000000000..8f2851f91 --- /dev/null +++ b/shell/ash_test/ash-misc/elif2.right | |||
@@ -0,0 +1,2 @@ | |||
1 | THEN | ||
2 | Ok:0 | ||
diff --git a/shell/ash_test/ash-misc/elif2.tests b/shell/ash_test/ash-misc/elif2.tests new file mode 100755 index 000000000..3e5876f05 --- /dev/null +++ b/shell/ash_test/ash-misc/elif2.tests | |||
@@ -0,0 +1,8 @@ | |||
1 | if true; then | ||
2 | echo "THEN" | ||
3 | elif echo "ELIF false"; false; then | ||
4 | echo "ELIF THEN" | ||
5 | else | ||
6 | echo "ELSE" | ||
7 | fi | ||
8 | echo "Ok:$?" | ||