aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--procps/kill.c5
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)
184 if (is_killall5 && arg[0] == 'o') 184 if (is_killall5 && arg[0] == 'o')
185 goto do_it_now; 185 goto do_it_now;
186 186
187 /* "--" separates options from args. Testcase: "kill -- -123" */
188 if (!is_killall5 && arg[0] == '-' && arg[1] == '\0')
189 goto do_it_sooner;
190
187 if (argv[1] && arg[0] == 's' && arg[1] == '\0') { /* -s SIG? */ 191 if (argv[1] && arg[0] == 's' && arg[1] == '\0') { /* -s SIG? */
188 arg = *++argv; 192 arg = *++argv;
189 } /* else it must be -SIG */ 193 } /* else it must be -SIG */
@@ -192,6 +196,7 @@ int kill_main(int argc UNUSED_PARAM, char **argv)
192 bb_error_msg("bad signal name '%s'", arg); 196 bb_error_msg("bad signal name '%s'", arg);
193 return EXIT_FAILURE; 197 return EXIT_FAILURE;
194 } 198 }
199 do_it_sooner:
195 arg = *++argv; 200 arg = *++argv;
196 201
197 do_it_now: 202 do_it_now: