aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-07-01 16:15:55 -0700
committerRob Landley <rob@landley.net>2019-07-06 16:15:35 -0500
commit82a33b3f060e163b14155e8f6833ec30514a609b (patch)
tree8ea5cce41b024233ef8af23dcaf12a1068e9b0be /lib
parent3d8bbdc83d8b4891c1b887942e054974eb6291b7 (diff)
downloadtoybox-82a33b3f060e163b14155e8f6833ec30514a609b.tar.gz
killall: better handling of long names.
Change names_to_pid() so that we can actually match shell scripts with long names (the code to get the shell script's name was correct, but there was an extra test preventing us from actually comparing it to the sought name). In kill.c itself, remove a dead test for -l and switch to the FLAG() macro. Also extend the tests to explicitly cover long and short names.
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lib.c b/lib/lib.c
index b488407e..e00278c5 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -1093,7 +1093,7 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name))
cmd[len] = 0;
}
if (!strcmp(bb, getbasename(cmd))) goto match;
- if (bb!=*cur && !strcmp(bb, getbasename(cmd+strlen(cmd)+1))) goto match;
+ if (!strcmp(bb, getbasename(cmd+strlen(cmd)+1))) goto match;
continue;
match:
if (callback(u, *cur)) break;