aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-28 23:17:31 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-28 23:17:31 +0000
commit918a34b9e04cbf368dd7a1116d7467e6e7f8ccc9 (patch)
treee210dcb9b76b230df380c56334f9a26d6f0aa05e /shell/hush.c
parent6a2d40f239566e886ef76542a75662cee9380a0e (diff)
downloadbusybox-918a34b9e04cbf368dd7a1116d7467e6e7f8ccc9.tar.gz
hush: fix "while false; ..." exitcode; add testsuites
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index a74fe4730..5b2f188cd 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2305,8 +2305,10 @@ static int run_list(struct pipe *pi)
#endif
#if ENABLE_HUSH_LOOPS
if (rword == RES_WHILE) {
- if (rcode)
+ if (rcode) {
+ rcode = 0; /* "while false; do...done" - exitcode 0 */
goto check_jobs_and_break;
+ }
}
if (rword == RES_UNTIL) {
if (!rcode) {