Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Oct 2002 14:09:52 -0700 (PDT)
From:      Brian Feldman <green@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 18561 for review
Message-ID:  <200210022109.g92L9qKr078106@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18561

Change 18561 by green@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@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210022109.g92L9qKr078106>