← Commit list

30bfcf612

Denys Vlasenko
Denys Vlasenko
2016-11-04
SUCCESS Duration: 236s

Subject

hush: non-matching "case" statement sets $? to 0

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+2 -0
@@ -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;
}