mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Andrej Picej <andrej.picej@norik.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] hush: fix conditional statements exit code
Date: Mon, 23 Aug 2021 15:36:49 +0200	[thread overview]
Message-ID: <20210823133649.GG24834@pengutronix.de> (raw)
In-Reply-To: <20210810054712.1547433-1-andrej.picej@norik.com>

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@norik.com>
> ---
> 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-08-23 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  5:47 Andrej Picej
2021-08-23 13:36 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210823133649.GG24834@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=andrej.picej@norik.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox