Bug 6170 - hush bug : broken while
Summary: hush bug : broken while
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-05 12:42 UTC by Denis.Ryndine
Modified: 2013-04-07 16:18 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis.Ryndine 2013-04-05 12:42:52 UTC
BusyBox version
BusyBox v1.20.2 (2013-04-04 13:18:53 UTC) hush - the humble shell

This runs (not) as expected
while [ 3 -lt 3 ] ;  do echo running;  done

But this is infinite loop
while [ 3 -lt 3 ] && true ;  do echo running;  done
Comment 1 Denis.Ryndine 2013-04-05 13:20:20 UTC
[ 3 -lt 3 ]; echo $?
1
[ 3 -lt 3 ] && true; echo $?
1

So then seems broken while?
Comment 2 Denys Vlasenko 2013-04-07 16:18:58 UTC
Thanks for reporting it.

Fixed in git:

commit 3beab83e4f7f4213c185737e95dc4895f0059dd6
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date:   Sun Apr 7 18:16:58 2013 +0200

    hush: fix for "while false && true; do echo BUG; break; done"