From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 5 Jun 2014 18:47:58 -0400 Subject: [U-Boot] [U-Boot, v2, 3/4] Fix hush to give the correct return code for a simple command In-Reply-To: <1401482511-9647-4-git-send-email-sjg@chromium.org> References: <1401482511-9647-4-git-send-email-sjg@chromium.org> Message-ID: <20140605224758.GU7841@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, May 30, 2014 at 02:41:50PM -0600, Simon Glass wrote: > When a simple command like 'false' is provided, hush should return the > result of that command. However, hush only does this if the > FLAG_EXIT_FROM_LOOP flag is provided. Without this flag, hush will > happily execute the empty string command immediate after 'false' and > then return a success code. > > This behaviour does not seem very useful, and requiring the flag also > seems wrong, since it means that hush will execute only the first command > in a sequence. > > Add a check for empty string and fall out of the loop in that case. That > at least fixes the simple command case. This is a change in behaviour but > it is unlikely that the old behaviour would be considered correct in any > case. > > Reported-by: Stefan Herbrechtsmeier > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: