mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104796
|
@ -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…
Reference in a new issue