aboutsummaryrefslogtreecommitdiff
path: root/winsup/utils/kill.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/utils/kill.cc')
-rw-r--r--winsup/utils/kill.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc
index bcabcd4..1e6ab5c 100644
--- a/winsup/utils/kill.cc
+++ b/winsup/utils/kill.cc
@@ -372,7 +372,9 @@ main (int argc, char **argv)
case '?':
if (gotasig) /* this is a negative pid, go ahead */
{
- --optind;
+ /* Reset optind because it points to the next argument if and
+ only if the pid has one digit. */
+ optind = av - argv;
goto out;
}
optreset = 1;