PERFORCE change 18561 for review

Brian Feldman green at freebsd.org
Wed Oct 2 21:09:52 GMT 2002


http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18561

Change 18561 by green at green_laptop_2 on 2002/10/02 14:09:49

	Fix an error using strrchr(3) by replacing its use with
	basename(3) when finding the last component of the
	pathname in argv[0].

Affected files ...

.. //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#2 edit

Differences ...

==== //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#2 (text+ko) ====

@@ -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 @@
 	visbuflen = buflen = 0;
 	visbuf = buf = NULL;
 
-	p = strrchr(argv[0], '/');
+	p = basename(argv[0]);
 	if (p == NULL)
 		p = argv[0];
 	if (!strcmp(p, "getextattr")) {
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list