[Bug 15571] New: hush will bypass commands after the first one in elif

bugzilla at busybox.net bugzilla at busybox.net
Fri May 19 09:12:37 UTC 2023


https://bugs.busybox.net/show_bug.cgi?id=15571

            Bug ID: 15571
           Summary: hush will bypass commands after the first one in elif
           Product: Busybox
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: vsfos at qq.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Created attachment 9591
  --> https://bugs.busybox.net/attachment.cgi?id=9591&action=edit
patch to fix the bug, but need more test

Busybox is at the top of the git repo.

Tested on WSL ubuntu and orangepi linux by running the test script with command
line: busybox hush test

the test script:
#!/bin/sh
if false; then
        : nothing
elif echo 'test-1'; echo 'test-2' ; echo 'test-3'; then
        echo "abcdefg-1"
fi
echo again
if echo 'test-1'; echo 'test-2' ; echo 'test-3'; then
        echo "abcdefg-1"
fi

Output of the test script on hush:
# ./busybox hush test
test-1
again
test-1
test-2
test-3
abcdefg-1

Output of the test script on bash:
#bash test
test-1
test-2
test-3
abcdefg-1
again
test-1
test-2
test-3
abcdefg-1

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list