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
8de660271f
. Revert that.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
7e671e7578
commit
5e6ce1cfb2
|
@ -11,3 +11,6 @@ Bug Fixes
|
||||||
|
|
||||||
- Relax fork child permissions to avoid a potential fork failure.
|
- Relax fork child permissions to avoid a potential fork failure.
|
||||||
Addresses: https://cygwin.com/ml/cygwin/2019-02/msg00234.html
|
Addresses: https://cygwin.com/ml/cygwin/2019-02/msg00234.html
|
||||||
|
|
||||||
|
- Fix Command-line argument handling of kill(1) in terms of negative PID.
|
||||||
|
Addresses: report on IRC
|
||||||
|
|
|
@ -251,7 +251,10 @@ main (int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
if (gotasig) /* this is a negative pid, go ahead */
|
if (gotasig) /* this is a negative pid, go ahead */
|
||||||
goto out;
|
{
|
||||||
|
--optind;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
optreset = 1;
|
optreset = 1;
|
||||||
optind = 1 + av - argv;
|
optind = 1 + av - argv;
|
||||||
gotasig = *av + 1;
|
gotasig = *av + 1;
|
||||||
|
|
Loading…
Reference in New Issue