Re: [PATCH] hush: fix conditional statements exit code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 10, 2021 at 07:47:12AM +0200, Andrej Picej wrote:
> Fix conditional statements ("if" , "elif", "while" and "until") exit
> code when used in scripts. Before the change, when conditional statement
> evaluated false just before the end of the script, script's exit code
> would have been 1 (instead of 0), which implies error condition. This is
> not expected nor desired behavior, so correct it by handling such cases
> and passing exit code 0 (SUCCESS) instead in such situations.
> 
> Signed-off-by: Andrej Picej <andrej.picej@xxxxxxxxx>
> ---
> This problem/bug was previously discussed on barebox mailing list.
> Although a simple workaround was found (explicit exit 0 at the end of
> scripts), a decision for fixing Hush was encouraged.
> ---
>  common/hush.c | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)

Tested and applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux