diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/kill.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/procps/kill.c b/procps/kill.c index 0ddae2f70..24cc903fc 100644 --- a/procps/kill.c +++ b/procps/kill.c @@ -184,6 +184,10 @@ int kill_main(int argc UNUSED_PARAM, char **argv) if (is_killall5 && arg[0] == 'o') goto do_it_now; + /* "--" separates options from args. Testcase: "kill -- -123" */ + if (!is_killall5 && arg[0] == '-' && arg[1] == '\0') + goto do_it_sooner; + if (argv[1] && arg[0] == 's' && arg[1] == '\0') { /* -s SIG? */ arg = *++argv; } /* else it must be -SIG */ @@ -192,6 +196,7 @@ int kill_main(int argc UNUSED_PARAM, char **argv) bb_error_msg("bad signal name '%s'", arg); return EXIT_FAILURE; } + do_it_sooner: arg = *++argv; do_it_now: |