]> granicus.if.org Git - procps-ng/commit
kill: -l space between name parses correctly
authorCraig Small <csmall@enc.com.au>
Tue, 7 Feb 2017 11:05:18 +0000 (22:05 +1100)
committerCraig Small <csmall@enc.com.au>
Tue, 7 Feb 2017 11:05:18 +0000 (22:05 +1100)
commit536cea324b121f54744369425332c256aa84a181
tree0512b72eeb4830adc0f7ad802d0d93463095c643
parent625d0809daa5b666d9f5834bebcdc458799221f3
kill: -l space between name parses correctly

kill -lHUP would work correctly, but kill -l HUP would not.

The list option in kill was hit by a quirk of getopt_long where an
option with an optional argument would not attempt to get the argument
beyond the space, even though a mandatory argument would do that.

The fix is a kludge to scan to the next argument and if it looks
like something we can use, use it. Lucky for us, the list option is
one where parsing can stop immediately.

Thanks to Brian Vandenberg for the way forward.

References:
 http://stackoverflow.com/questions/1052746/getopt-does-not-parse-optional-arguments-to-parameters
 https://bugs.debian.org/854407
NEWS
skill.c
testsuite/kill.test/kill.exp