aboutsummaryrefslogtreecommitdiff
path: root/winsup/utils
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-02-17 22:59:36 +0100
committerCorinna Vinschen <corinna@vinschen.de>2019-02-18 10:22:37 +0100
commit5e6ce1cfb212a6dd71790933186275081cffe3c3 (patch)
treeccf18af72f5402e755493af353b182dc3e08db93 /winsup/utils
parent7e671e75787777c9ab8a1144a10c1187b7ced984 (diff)
downloadnewlib-5e6ce1cfb212a6dd71790933186275081cffe3c3.zip
newlib-5e6ce1cfb212a6dd71790933186275081cffe3c3.tar.gz
newlib-5e6ce1cfb212a6dd71790933186275081cffe3c3.tar.bz2
Cygwin: utils: kill: revert erroneously removed optind correction
When recognizing a negative pid, optind is off by one. The code correcting this has been erroneously removed by commit 8de660271fe75a6993f1c9888d24b824bb7f999d. Revert that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/kill.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc
index 768ac44..a22d702 100644
--- a/winsup/utils/kill.cc
+++ b/winsup/utils/kill.cc
@@ -251,7 +251,10 @@ main (int argc, char **argv)
break;
case '?':
if (gotasig) /* this is a negative pid, go ahead */
- goto out;
+ {
+ --optind;
+ goto out;
+ }
optreset = 1;
optind = 1 + av - argv;
gotasig = *av + 1;