summaryrefslogtreecommitdiff
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-04 17:52:48 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2016-11-04 17:52:48 (GMT)
commit30bfcf612b0862e4dd98d923eabb308b54012d24 (patch)
tree2d904e2c9fca9deeda6cfe81c01b9cbdd4b7e573
parent672a55e606fc50e4ffe7810bd0d9cd1cf9b980a3 (diff)
downloadbusybox-30bfcf612b0862e4dd98d923eabb308b54012d24.zip
busybox-30bfcf612b0862e4dd98d923eabb308b54012d24.tar.gz
busybox-30bfcf612b0862e4dd98d923eabb308b54012d24.tar.bz2
hush: non-matching "case" statement sets $? to 0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat
-rw-r--r--shell/hush.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 336de75..4c2ed6c 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -7874,6 +7874,8 @@ static int run_list(struct pipe *pi)
#endif
#if ENABLE_HUSH_CASE
if (rword == RES_CASE) {
+ /* Case which does not match and execute anything still sets $? to 0 */
+ G.last_exitcode = rcode = EXIT_SUCCESS;
case_word = expand_strvec_to_string(pi->cmds->argv);
continue;
}