mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
top(1): Use basename instead of a homegrown alternative
This commit is contained in:
parent
9324388b0a
commit
ac8f40ea78
1 changed files with 2 additions and 5 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue