Support the "--" end of options marker, useful to disambiguate between

signal numbers and process groups (negative pid arguments), and
required by SUSv3.
This commit is contained in:
Tim J. Robbins 2002-06-13 08:07:20 +00:00
parent 83952a118b
commit 08de34ac01

View File

@ -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();