Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-04-12 13:23:36 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-04-25 17:47:22 +0300
commit384cd2e436e9b15a7ffe2bf93260d94992dc1193 (patch)
tree1b74658ab32e4afda2824da062843397028460f8
parentce839dea92ce10627094096835e831bf5d267631 (diff)
sleep: fix error exit when called as "sh" builtin
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/sleep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index 667db558d..a0cee5a4a 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -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;
}