diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-10-10 16:37:12 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-10-10 16:37:12 +0000 |
commit | 0a548c25a20abf525bbadfd18897146c14c142ac (patch) | |
tree | 5fbe80ad8b7941fdd81ad643f8410fa44df5cb28 /usr.sbin/extattr | |
parent | 3c7ee81a0cce48f513ab45199a8b8d51b620e77d (diff) | |
download | FreeBSD-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.c | 3 |
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")) { |