]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: utils: kill: revert erroneously removed optind correction
authorCorinna Vinschen <corinna@vinschen.de>
Sun, 17 Feb 2019 21:59:36 +0000 (22:59 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 18 Feb 2019 09:22:37 +0000 (10:22 +0100)
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>
winsup/cygwin/release/3.0.1
winsup/utils/kill.cc

index ae6e03ea6610fb3c0aba2c3ac0bee577126f528a..fd6595b98ee88d180c083a9f85d0d063a043665b 100644 (file)
@@ -11,3 +11,6 @@ Bug Fixes
 
 - Relax fork child permissions to avoid a potential fork failure.
   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
index 768ac44e7f92bd8fdb2fe19fb07b960ddbffd1bc..a22d70253f5c075bfd9016cf7c60d3bbfc174541 100644 (file)
@@ -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;
This page took 0.033027 seconds and 5 git commands to generate.