summaryrefslogtreecommitdiffstats
path: root/usr.sbin/extattr
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-10-10 16:37:12 +0000
committerrwatson <rwatson@FreeBSD.org>2002-10-10 16:37:12 +0000
commit0a548c25a20abf525bbadfd18897146c14c142ac (patch)
tree5fbe80ad8b7941fdd81ad643f8410fa44df5cb28 /usr.sbin/extattr
parent3c7ee81a0cce48f513ab45199a8b8d51b620e77d (diff)
downloadFreeBSD-src-0a548c25a20abf525bbadfd18897146c14c142ac.zip
FreeBSD-src-0a548c25a20abf525bbadfd18897146c14c142ac.tar.gz
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
Diffstat (limited to 'usr.sbin/extattr')
-rw-r--r--usr.sbin/extattr/rmextattr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/extattr/rmextattr.c b/usr.sbin/extattr/rmextattr.c
index 79cd163..e240232 100644
--- a/usr.sbin/extattr/rmextattr.c
+++ b/usr.sbin/extattr/rmextattr.c
@@ -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")) {
OpenPOWER on IntegriCloud