← Commit list

550e6d8fb

Denys Vlasenko
Denys Vlasenko
2023-04-12
SUCCESS Duration: 155s

Subject

sleep: fix error exit when called as "sh" builtin

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 →

coreutils/sleep.c+2 -1
@@ -74,7 +74,8 @@ int sleep_main(int argc UNUSED_PARAM, char **argv)
++argv;
if (!*argv) {
/* Without this, bare "sleep" in ash shows _ash_ --help */
- if (ENABLE_ASH_SLEEP && applet_name[0] != 's') {
+ /* (ash can be the "sh" applet as well, so check 2nd char) */
+ if (ENABLE_ASH_SLEEP && applet_name[1] != 'l') {
bb_simple_error_msg("sleep: missing operand");
return EXIT_FAILURE;
}