summaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko2023-05-25 14:22:10 +0200
committerDenys Vlasenko2023-05-25 14:22:10 +0200
commit6824298ab4d3da40763af4d2d466a72745b8b593 (patch)
tree13382dd9610b5154e79ad971f17f1dc54f13ea1a /shell/hush_test
parent3e83699ce23400d75c7ddaa7ebfdec015177caa7 (diff)
downloadbusybox-6824298ab4d3da40763af4d2d466a72745b8b593.zip
busybox-6824298ab4d3da40763af4d2d466a72745b8b593.tar.gz
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/hush_test')
-rw-r--r--shell/hush_test/hush-misc/elif1.right4
-rwxr-xr-xshell/hush_test/hush-misc/elif1.tests6
-rw-r--r--shell/hush_test/hush-misc/elif2.right2
-rwxr-xr-xshell/hush_test/hush-misc/elif2.tests8
4 files changed, 20 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/elif1.right b/shell/hush_test/hush-misc/elif1.right
new file mode 100644
index 0000000..36dc59f
--- /dev/null
+++ b/shell/hush_test/hush-misc/elif1.right
@@ -0,0 +1,4 @@
+ELIF1
+ELIF2
+ELIF THEN
+Ok:0
diff --git a/shell/hush_test/hush-misc/elif1.tests b/shell/hush_test/hush-misc/elif1.tests
new file mode 100755
index 0000000..77b8a25
--- /dev/null
+++ b/shell/hush_test/hush-misc/elif1.tests
@@ -0,0 +1,6 @@
+if false; then
+ :
+elif echo 'ELIF1'; echo 'ELIF2'; then
+ echo "ELIF THEN"
+fi
+echo "Ok:$?"
diff --git a/shell/hush_test/hush-misc/elif2.right b/shell/hush_test/hush-misc/elif2.right
new file mode 100644
index 0000000..8f2851f
--- /dev/null
+++ b/shell/hush_test/hush-misc/elif2.right
@@ -0,0 +1,2 @@
+THEN
+Ok:0
diff --git a/shell/hush_test/hush-misc/elif2.tests b/shell/hush_test/hush-misc/elif2.tests
new file mode 100755
index 0000000..3e5876f
--- /dev/null
+++ b/shell/hush_test/hush-misc/elif2.tests
@@ -0,0 +1,8 @@
+if true; then
+ echo "THEN"
+elif echo "ELIF false"; false; then
+ echo "ELIF THEN"
+else
+ echo "ELSE"
+fi
+echo "Ok:$?"