top(1): Use basename instead of a homegrown alternative

This commit is contained in:
Eitan Adler 2018-06-23 22:45:18 +00:00
parent 9324388b0a
commit ac8f40ea78
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335589

View File

@ -29,6 +29,7 @@
#include <assert.h>
#include <err.h>
#include <libgen.h>
#include <kvm.h>
#include <math.h>
#include <paths.h>
@ -992,11 +993,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags
dst = argbuf;
/* Extract cmd name from argv */
cmd = strrchr(*args, '/');
if (cmd == NULL)
cmd = *args;
else
cmd++;
cmd = basename(*args);
for (; (src = *args++) != NULL; ) {
if (*src == '\0')