From 08de34ac0165ebafd0788b57a39554e33b27e645 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Thu, 13 Jun 2002 08:07:20 +0000 Subject: [PATCH] Support the "--" end of options marker, useful to disambiguate between signal numbers and process groups (negative pid arguments), and required by SUSv3. --- bin/kill/kill.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/kill/kill.c b/bin/kill/kill.c index 48198c82e5d3..865c9db426b3 100644 --- a/bin/kill/kill.c +++ b/bin/kill/kill.c @@ -103,7 +103,7 @@ main(int argc, char *argv[]) } else numsig = 0; argc--, argv++; - } else if (**argv == '-') { + } else if (**argv == '-' && *(*argv + 1) != '-') { ++*argv; if (isalpha(**argv)) { if ((numsig = signame_to_signum(*argv)) < 0) @@ -119,6 +119,9 @@ main(int argc, char *argv[]) argc--, argv++; } + if (argc > 0 && strncmp(*argv, "--", 2) == 0) + argc--, argv++; + if (argc == 0) usage();