Use basename(3) to derive the name of the binary from argv[0].
Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Submitted by: green
This commit is contained in:
parent
d61e0656e1
commit
7522ecb37f
@ -40,6 +40,7 @@
|
||||
#include <sys/uio.h>
|
||||
#include <sys/extattr.h>
|
||||
|
||||
#include <libgen.h>
|
||||
#include <libutil.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -111,7 +112,7 @@ main(int argc, char *argv[])
|
||||
visbuflen = buflen = 0;
|
||||
visbuf = buf = NULL;
|
||||
|
||||
p = strrchr(argv[0], '/');
|
||||
p = basename(argv[0]);
|
||||
if (p == NULL)
|
||||
p = argv[0];
|
||||
if (!strcmp(p, "getextattr")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user