]> granicus.if.org Git - procps-ng/commitdiff
pkill -u uid fix
authorAlfredo Esteban <aedelatorre@gmail.com>
Mon, 11 Jun 2012 12:30:01 +0000 (22:30 +1000)
committerCraig Small <csmall@enc.com.au>
Mon, 11 Jun 2012 12:30:01 +0000 (22:30 +1000)
pkill would not parse -u <uid> options correctly and needed no space
between the flag and uid.

Bug-Debian: http://bugs.debian.org/676239
Signed-Of-By: Craig Small <csmall@enc.com.au>
NEWS
pgrep.c

diff --git a/NEWS b/NEWS
index bdaa3f140d28fc272990ad21b96998ca3686ee13..3cdb895228d4415e575d85eaf235fd84bcb02bfb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ procps-ng-3.3.4
   * w get -i option to display IP addresses
   * watch 8bit fixes Debian #675069
   * Fixed FTBFS for non-linux Debian #677055
+  * pkill -u <uid> doesnt need space Debian #676239
 
 procps-ng-3.3.3
 ---------------
diff --git a/pgrep.c b/pgrep.c
index fed70b98d734671bc440b48e34334b3eab8791dd..5b39c0c826b752efbfd13849284cb589808cdb39 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -564,7 +564,7 @@ int signal_option(int *argc, char **argv)
 {
        int sig;
        int i = 1;
-       while (i < *argc) {
+       if (argc > 2 && argv[1][0] == '-') {
                sig = signal_name_to_number(argv[i] + 1);
                if (sig == -1 && isdigit(argv[1][1]))
                        sig = atoi(argv[1] + 1);