| Summary: | hush will bypass commands after the first one in elif | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | SimonQian <vsfos> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | patch to fix the bug, but need more test | ||
The attached patch is wrong. Fixed in git, thank you.
commit 6824298ab4d3da40763af4d2d466a72745b8b593
Date: Thu May 25 14:22:10 2023 +0200
hush: fix ELIF cmd1;cmd2 THEN ... not executing cmd2, closes 15571
|
Created attachment 9591 [details] 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