aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-04-12 21:41:29 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-04-12 21:41:29 +0000
commit7b0ed37e692f8dd66cb747309f8dcfb132b0ca62 (patch)
tree0cb5961606795454bcd2aed65977d43d28ad5d77
parent00100a5bbdd51002acaa94a05624ad25f9bd7628 (diff)
downloadbusybox-w32-7b0ed37e692f8dd66cb747309f8dcfb132b0ca62.tar.gz
busybox-w32-7b0ed37e692f8dd66cb747309f8dcfb132b0ca62.tar.bz2
busybox-w32-7b0ed37e692f8dd66cb747309f8dcfb132b0ca62.zip
Wolfgang Denk writes:
He, there is a bug in HUSH's handling of "if" / "elif" commands: $ if true > then > echo 1 > elif > true > then > echo 2 > elif > true > then > echo 3 > else > echo 4 > fi 1 2 3 $ The same bug exists in all versions of HUSH from BB v0.60.x up to and including v1.00-pre9. The attached patch fixes this: $ if true > then > echo 1 > elif > true > then > echo 2 > elif > true > then > echo 3 > else > echo 4 > fi 1 $ Best regards, Wolfgang Denk git-svn-id: svn://busybox.net/trunk/busybox@8747 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--shell/hush.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 8f4cc9780..6d31cdca5 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -1557,7 +1557,7 @@ static int run_list_real(struct pipe *pi)
1557 if (rmode == RES_THEN || rmode == RES_ELSE) if_code = next_if_code; 1557 if (rmode == RES_THEN || rmode == RES_ELSE) if_code = next_if_code;
1558 if (rmode == RES_THEN && if_code) continue; 1558 if (rmode == RES_THEN && if_code) continue;
1559 if (rmode == RES_ELSE && !if_code) continue; 1559 if (rmode == RES_ELSE && !if_code) continue;
1560 if (rmode == RES_ELIF && !if_code) continue; 1560 if (rmode == RES_ELIF && !if_code) break;
1561 if (rmode == RES_FOR && pi->num_progs) { 1561 if (rmode == RES_FOR && pi->num_progs) {
1562 if (!list) { 1562 if (!list) {
1563 /* if no variable values after "in" we skip "for" */ 1563 /* if no variable values after "in" we skip "for" */