Index: chkey/chkey.c
===================================================================
RCS file: /cvs/src/usr.bin/chkey/chkey.c,v
retrieving revision 1.3
diff -u -r1.3 chkey.c
--- chkey/chkey.c	2 Oct 2003 17:42:26 -0000	1.3
+++ chkey/chkey.c	29 Aug 2004 21:27:14 -0000
@@ -266,12 +266,12 @@
 			&val, &vallen) != 0) {
 		return (NULL);
 	}
-	p = index(val, ':');
+	p = strchr(val, ':');
 	if (p == NULL) {	
 		return (NULL);
 	}
 	pw.pw_passwd = p + 1;
-	p = index(pw.pw_passwd, ':');
+	p = strchr(pw.pw_passwd, ':');
 	if (p == NULL) {
 		return (NULL);
 	}
Index: cksum/cksum.c
===================================================================
RCS file: /cvs/src/usr.bin/cksum/cksum.c,v
retrieving revision 1.4
diff -u -r1.4 cksum.c
--- cksum/cksum.c	3 Nov 2003 19:31:28 -0000	1.4
+++ cksum/cksum.c	29 Aug 2004 21:27:14 -0000
@@ -61,7 +61,7 @@
 	int (*cfncn)(int, u_int32_t *, u_int32_t *);
 	void (*pfncn)(char *, u_int32_t, u_int32_t);
 
-	if ((p = rindex(argv[0], '/')) == NULL)
+	if ((p = strrchr(argv[0], '/')) == NULL)
 		p = argv[0];
 	else
 		++p;
Index: compress/compress.c
===================================================================
RCS file: /cvs/src/usr.bin/compress/compress.c,v
retrieving revision 1.3
diff -u -r1.3 compress.c
--- compress/compress.c	2 Oct 2003 17:42:27 -0000	1.3
+++ compress/compress.c	29 Aug 2004 21:27:14 -0000
@@ -69,7 +69,7 @@
 	char *p, newname[MAXPATHLEN];
 
 	cat = 0;
-	if ((p = rindex(argv[0], '/')) == NULL)
+	if ((p = strrchr(argv[0], '/')) == NULL)
 		p = argv[0];
 	else
 		++p;
@@ -135,7 +135,7 @@
 				compress(*argv, "/dev/stdout", bits);
 				break;
 			}
-			if ((p = rindex(*argv, '.')) != NULL &&
+			if ((p = strrchr(*argv, '.')) != NULL &&
 			    !strcmp(p, ".Z")) {
 				cwarnx("%s: name already has trailing .Z",
 				    *argv);
@@ -158,7 +158,7 @@
 				break;
 			}
 			len = strlen(*argv);
-			if ((p = rindex(*argv, '.')) == NULL ||
+			if ((p = strrchr(*argv, '.')) == NULL ||
 			    strcmp(p, ".Z")) {
 				if (len > sizeof(newname) - 3) {
 					cwarnx("%s: name too long", *argv);
Index: finger/finger.c
===================================================================
RCS file: /cvs/src/usr.bin/finger/finger.c,v
retrieving revision 1.3
diff -u -r1.3 finger.c
--- finger/finger.c	4 Oct 2003 20:36:44 -0000	1.3
+++ finger/finger.c	29 Aug 2004 21:27:15 -0000
@@ -274,7 +274,7 @@
 
 	/* Pull out all network requests. */
 	for (ap = p = argv, np = nargv; *p; ++p)
-		if (index(*p, '@'))
+		if (strchr(*p, '@'))
 			*np++ = *p;
 		else
 			*ap++ = *p;
Index: hexdump/display.c
===================================================================
RCS file: /cvs/src/usr.bin/hexdump/display.c,v
retrieving revision 1.3
diff -u -r1.3 display.c
--- hexdump/display.c	4 Oct 2003 20:36:45 -0000	1.3
+++ hexdump/display.c	29 Aug 2004 21:27:15 -0000
@@ -219,7 +219,7 @@
 	pr->cchar[0] = 's';
 	pr->cchar[1] = '\0';
 	for (p1 = pr->fmt; *p1 != '%'; ++p1);
-	for (p2 = ++p1; *p1 && index(spec, *p1); ++p1);
+	for (p2 = ++p1; *p1 && strchr(spec, *p1); ++p1);
 	while ((*p2++ = *p1++));
 }
 
Index: hexdump/hexdump.c
===================================================================
RCS file: /cvs/src/usr.bin/hexdump/hexdump.c,v
retrieving revision 1.3
diff -u -r1.3 hexdump.c
--- hexdump/hexdump.c	4 Oct 2003 20:36:45 -0000	1.3
+++ hexdump/hexdump.c	29 Aug 2004 21:27:15 -0000
@@ -56,7 +56,7 @@
 
 	(void)setlocale(LC_ALL, "");
 
-	if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od"))
+	if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od"))
 		newsyntax(argc, &argv);
 	else
 		oldsyntax(argc, &argv);
Index: hexdump/hexsyntax.c
===================================================================
RCS file: /cvs/src/usr.bin/hexdump/hexsyntax.c,v
retrieving revision 1.3
diff -u -r1.3 hexsyntax.c
--- hexdump/hexsyntax.c	4 Oct 2003 20:36:45 -0000	1.3
+++ hexdump/hexsyntax.c	29 Aug 2004 21:27:15 -0000
@@ -54,7 +54,7 @@
 	char *p, **argv;
 
 	argv = *argvp;
-	if ((p = rindex(argv[0], 'h')) != NULL &&
+	if ((p = strrchr(argv[0], 'h')) != NULL &&
 	    strcmp(p, "hd") == 0) {
 		/* "Canonical" format, implies -C. */
 		add("\"%08.8_Ax\n\"");
Index: hexdump/parse.c
===================================================================
RCS file: /cvs/src/usr.bin/hexdump/parse.c,v
retrieving revision 1.3
diff -u -r1.3 parse.c
--- hexdump/parse.c	4 Oct 2003 20:36:45 -0000	1.3
+++ hexdump/parse.c	29 Aug 2004 21:27:15 -0000
@@ -58,7 +58,7 @@
 	if ((fp = fopen(name, "r")) == NULL)
 		err(1, "%s", name);
 	while (fgets(buf, sizeof(buf), fp)) {
-		if (!(p = index(buf, '\n'))) {
+		if (!(p = strchr(buf, '\n'))) {
 			warnx("line too long");
 			while ((ch = getchar()) != '\n' && ch != EOF);
 			continue;
@@ -168,7 +168,7 @@
 			 * skip any special chars -- save precision in
 			 * case it's a %s format.
 			 */
-			while (index(spec + 1, *++fmt));
+			while (strchr(spec + 1, *++fmt));
 			if (*fmt == '.' && isdigit(*++fmt)) {
 				prec = atoi(fmt);
 				while (isdigit(*++fmt));
@@ -240,10 +240,10 @@
 			if (fu->bcnt) {
 				sokay = USEBCNT;
 				/* Skip to conversion character. */
-				for (++p1; index(spec, *p1); ++p1);
+				for (++p1; strchr(spec, *p1); ++p1);
 			} else {
 				/* Skip any special chars, field width. */
-				while (index(spec + 1, *++p1));
+				while (strchr(spec + 1, *++p1));
 				if (*p1 == '.' && isdigit(*++p1)) {
 					sokay = USEPREC;
 					prec = atoi(p1);
Index: netstat/if.c
===================================================================
RCS file: /cvs/src/usr.bin/netstat/if.c,v
retrieving revision 1.6
diff -u -r1.6 if.c
--- netstat/if.c	19 Aug 2004 23:35:45 -0000	1.6
+++ netstat/if.c	29 Aug 2004 21:27:17 -0000
@@ -233,7 +233,7 @@
 			ifnetaddr = (u_long)TAILQ_NEXT(&ifnet, if_link);
 			if (interface != 0 && (strcmp(name, interface) != 0))
 				continue;
-			cp = index(name, '\0');
+			cp = strchr(name, '\0');
 
 			if (pfunc) {
 				(*pfunc)(name);
Index: netstat/inet.c
===================================================================
RCS file: /cvs/src/usr.bin/netstat/inet.c,v
retrieving revision 1.14
diff -u -r1.14 inet.c
--- netstat/inet.c	7 Jun 2004 02:36:28 -0000	1.14
+++ netstat/inet.c	29 Aug 2004 21:27:17 -0000
@@ -843,7 +843,7 @@
 	    sprintf(line, "%s.", inetname(in));
 	else
 	    sprintf(line, "%.*s.", (Aflag && !numeric_port) ? 12 : 16, inetname(in));
-	cp = index(line, '\0');
+	cp = strchr(line, '\0');
 	if (!numeric_port && port)
 		sp = getservbyport((int)port, proto);
 	if (sp || port == 0)
Index: netstat/inet6.c
===================================================================
RCS file: /cvs/src/usr.bin/netstat/inet6.c,v
retrieving revision 1.3
diff -u -r1.3 inet6.c
--- netstat/inet6.c	11 Jun 2004 12:03:15 -0000	1.3
+++ netstat/inet6.c	29 Aug 2004 21:27:17 -0000
@@ -1050,7 +1050,7 @@
 
 	sprintf(line, "%.*s.", Wflag ? 39 :
 		(Aflag && !numeric) ? 12 : 16, inet6name(in6));
-	cp = index(line, '\0');
+	cp = strchr(line, '\0');
 	if (!numeric && port)
 		GETSERVBYPORT6(port, proto, sp);
 	if (sp || port == 0)
@@ -1079,7 +1079,7 @@
 	if (first && !numeric_addr) {
 		first = 0;
 		if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
-		    (cp = index(domain, '.')))
+		    (cp = strchr(domain, '.')))
 			(void) strcpy(domain, cp + 1);
 		else
 			domain[0] = 0;
@@ -1088,7 +1088,7 @@
 	if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) {
 		hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6);
 		if (hp) {
-			if ((cp = index(hp->h_name, '.')) &&
+			if ((cp = strchr(hp->h_name, '.')) &&
 			    !strcmp(cp + 1, domain))
 				*cp = 0;
 			cp = hp->h_name;
Index: netstat/iso.c
===================================================================
RCS file: /cvs/src/usr.bin/netstat/iso.c,v
retrieving revision 1.2
diff -u -r1.2 iso.c
--- netstat/iso.c	17 Jun 2003 04:29:30 -0000	1.2
+++ netstat/iso.c	29 Aug 2004 21:27:17 -0000
@@ -397,7 +397,7 @@
 	int Alen = Aflag?18:22;
 
 	line =  isonetname(iso);
-	cp = index(line, '\0');
+	cp = strchr(line, '\0');
 	ihe = (struct iso_hostent *)0;
 
 	if( islocal )
Index: quota/quota.c
===================================================================
RCS file: /cvs/src/usr.bin/quota/quota.c,v
retrieving revision 1.3
diff -u -r1.3 quota.c
--- quota/quota.c	8 Aug 2003 04:18:43 -0000	1.3
+++ quota/quota.c	29 Aug 2004 21:27:17 -0000
@@ -510,7 +510,7 @@
 	}
 	strcpy(buf, fs->fs_mntops);
 	for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
-		if ((cp = index(opt, '=')))
+		if ((cp = strchr(opt, '=')))
 			*cp++ = '\0';
 		if (type == USRQUOTA && strcmp(opt, usrname) == 0)
 			break;
Index: ranlib/misc.c
===================================================================
RCS file: /cvs/src/usr.bin/ranlib/misc.c,v
retrieving revision 1.4
diff -u -r1.4 misc.c
--- ranlib/misc.c	24 Jul 2004 11:45:44 -0000	1.4
+++ ranlib/misc.c	29 Aug 2004 21:27:17 -0000
@@ -90,7 +90,7 @@
 {
 	register char *ind;
 
-	return((ind = rindex(path, '/')) ? ind + 1 : path);
+	return((ind = strrchr(path, '/')) ? ind + 1 : path);
 }
 
 void
Index: rlogin/rlogin.c
===================================================================
RCS file: /cvs/src/usr.bin/rlogin/rlogin.c,v
retrieving revision 1.3
diff -u -r1.3 rlogin.c
--- rlogin/rlogin.c	3 Nov 2003 19:31:32 -0000	1.3
+++ rlogin/rlogin.c	29 Aug 2004 21:27:18 -0000
@@ -160,7 +160,7 @@
 	one = 1;
 	host = localname = user = NULL;
 
-	if ((p = rindex(argv[0], '/')))
+	if ((p = strrchr(argv[0], '/')))
 		++p;
 	else
 		p = argv[0];
Index: rpcgen/rpc_main.c
===================================================================
RCS file: /cvs/src/usr.bin/rpcgen/rpc_main.c,v
retrieving revision 1.9
diff -u -r1.9 rpc_main.c
--- rpcgen/rpc_main.c	19 Jun 2004 16:40:36 -0000	1.9
+++ rpcgen/rpc_main.c	29 Aug 2004 21:27:18 -0000
@@ -222,7 +222,7 @@
 	char *p;
 	char *file;
 
-	if ((file = rindex(path, '/')) == NULL)
+	if ((file = strrchr(path, '/')) == NULL)
 		file = path;
 	else
 		file++;
@@ -787,7 +787,7 @@
 	if (allfiles) {
 		mkfilename = alloc(strlen("makefile.") +
 			strlen(cmd->infile) + 1);
-		temp = rindex(cmd->infile, '.');
+		temp = strrchr(cmd->infile, '.');
 		strcat(mkfilename, "makefile.");
 		strncat(mkfilename, cmd->infile, (temp - cmd->infile));
 	} else
Index: systat/devs.c
===================================================================
RCS file: /cvs/src/usr.bin/systat/devs.c,v
retrieving revision 1.3
diff -u -r1.3 devs.c
--- systat/devs.c	4 Oct 2003 20:36:51 -0000	1.3
+++ systat/devs.c	29 Aug 2004 21:27:18 -0000
@@ -255,7 +255,7 @@
 	register char *cp;
 	register int i;
 	int retval = 0;
-	char *index();
+	char *strchr();
 
 	/*
 	 * If we've gone through this code before, free previously
@@ -272,7 +272,7 @@
 	/* do an initial malloc */
 	specified_devices = (char **)malloc(sizeof(char *));
 
-	cp = index(args, '\n');
+	cp = strchr(args, '\n');
 	if (cp)
 		*cp = '\0';
 	for (;;) {
Index: systat/netcmds.c
===================================================================
RCS file: /cvs/src/usr.bin/systat/netcmds.c,v
retrieving revision 1.3
diff -u -r1.3 netcmds.c
--- systat/netcmds.c	4 Oct 2003 20:36:51 -0000	1.3
+++ systat/netcmds.c	29 Aug 2004 21:27:18 -0000
@@ -128,9 +128,9 @@
 	struct servent *sp;
 	struct hostent *hp;
 	struct in_addr in;
-	char *index();
+	char *strchr();
 
-	cp = index(args, '\n');
+	cp = strchr(args, '\n');
 	if (cp)
 		*cp = '\0';
 	for (;;args = cp) {
Index: systat/netstat.c
===================================================================
RCS file: /cvs/src/usr.bin/systat/netstat.c,v
retrieving revision 1.3
diff -u -r1.3 netstat.c
--- systat/netstat.c	4 Oct 2003 20:36:51 -0000	1.3
+++ systat/netstat.c	29 Aug 2004 21:27:18 -0000
@@ -360,10 +360,10 @@
 inetprint(register struct in_addr *in, int port, char *proto)
 {
 	struct servent *sp = 0;
-	char line[80], *cp, *index();
+	char line[80], *cp, *strchr();
 
 	snprintf(line, sizeof(line), "%.*s.", 16, inetname(*in));
-	cp = index(line, '\0');
+	cp = strchr(line, '\0');
 	if (!nflag && port)
 		sp = getservbyport(port, proto);
 	if (sp || port == 0)
@@ -373,7 +373,7 @@
 		snprintf(cp, sizeof(line) - (cp - line), "%d", 
 		    ntohs((u_short)port));
 	/* pad to full column to clear any garbage */
-	cp = index(line, '\0');
+	cp = strchr(line, '\0');
 	while (cp - line < 22)
 		*cp++ = ' ';
 	line[22] = '\0';
Index: talk/get_names.c
===================================================================
RCS file: /cvs/src/usr.bin/talk/get_names.c,v
retrieving revision 1.3
diff -u -r1.3 get_names.c
--- talk/get_names.c	4 Oct 2003 20:36:52 -0000	1.3
+++ talk/get_names.c	29 Aug 2004 21:27:18 -0000
@@ -77,7 +77,7 @@
 	gethostname(hostname, sizeof (hostname));
 	my_machine_name = hostname;
 	/* check for, and strip out, the machine name of the target */
-	for (cp = argv[1]; *cp && !index("@:!", *cp); cp++)
+	for (cp = argv[1]; *cp && !strchr("@:!", *cp); cp++)
 		;
 	if (*cp == '\0') {
 		/* this is a local to local talk */
Index: tftp/main.c
===================================================================
RCS file: /cvs/src/usr.bin/tftp/main.c,v
retrieving revision 1.4
diff -u -r1.4 main.c
--- tftp/main.c	4 Nov 2003 16:52:01 -0000	1.4
+++ tftp/main.c	29 Aug 2004 21:27:19 -0000
@@ -342,16 +342,16 @@
 		return;
 	}
 	targ = argv[argc - 1];
-	if (rindex(argv[argc - 1], ':')) {
+	if (strrchr(argv[argc - 1], ':')) {
 		char *cp;
 
 		for (n = 1; n < argc - 1; n++)
-			if (index(argv[n], ':')) {
+			if (strchr(argv[n], ':')) {
 				putusage(argv[0]);
 				return;
 			}
 		cp = argv[argc - 1];
-		targ = rindex(cp, ':');
+		targ = strrchr(cp, ':');
 		*targ++ = 0;
 		if (cp[0] == '[' && cp[strlen(cp) - 1] == ']') {
 			cp[strlen(cp) - 1] = '\0';
@@ -378,7 +378,7 @@
 	}
 				/* this assumes the target is a directory */
 				/* on a remote unix system.  hmmmm.  */
-	cp = index(targ, '\0');
+	cp = strchr(targ, '\0');
 	*cp++ = '/';
 	for (n = 1; n < argc - 1; n++) {
 		strcpy(cp, tail(argv[n]));
@@ -426,13 +426,13 @@
 	}
 	if (!connected) {
 		for (n = 1; n < argc ; n++)
-			if (rindex(argv[n], ':') == 0) {
+			if (strrchr(argv[n], ':') == 0) {
 				getusage(argv[0]);
 				return;
 			}
 	}
 	for (n = 1; n < argc ; n++) {
-		src = rindex(argv[n], ':');
+		src = strrchr(argv[n], ':');
 		if (src == NULL)
 			src = argv[n];
 		else {
@@ -560,7 +560,7 @@
 	register char *s;
 
 	while (*filename) {
-		s = rindex(filename, '/');
+		s = strrchr(filename, '/');
 		if (s == NULL)
 			break;
 		if (s[1])
Index: tftp/tftp.c
===================================================================
RCS file: /cvs/src/usr.bin/tftp/tftp.c,v
retrieving revision 1.3
diff -u -r1.3 tftp.c
--- tftp/tftp.c	4 Oct 2003 20:36:52 -0000	1.3
+++ tftp/tftp.c	29 Aug 2004 21:27:19 -0000
@@ -390,7 +390,7 @@
 	   { "#0", "RRQ", "WRQ", "DATA", "ACK", "ERROR" };
 	register char *cp, *file;
 	u_short op = ntohs(tp->th_opcode);
-	char *index();
+	char *strchr();
 
 	if (op < RRQ || op > ERROR)
 		printf("%s opcode=%x ", s, op);
@@ -402,7 +402,7 @@
 	case WRQ:
 		n -= 2;
 		file = cp = tp->th_stuff;
-		cp = index(cp, '\0');
+		cp = strchr(cp, '\0');
 		printf("<file=%s, mode=%s>\n", file, cp + 1);
 		break;
 
Index: tr/str.c
===================================================================
RCS file: /cvs/src/usr.bin/tr/str.c,v
retrieving revision 1.3
diff -u -r1.3 str.c
--- tr/str.c	4 Oct 2003 20:36:53 -0000	1.3
+++ tr/str.c	29 Aug 2004 21:27:19 -0000
@@ -140,7 +140,7 @@
 	repeat:
 		if ((p = strpbrk(s->str + 2, "*]")) == NULL)
 			return (0);
-		if (p[0] != '*' || index(p, ']') == NULL)
+		if (p[0] != '*' || strchr(p, ']') == NULL)
 			return (0);
 		s->str += 1;
 		genseq(s);
Index: tset/map.c
===================================================================
RCS file: /cvs/src/usr.bin/tset/map.c,v
retrieving revision 1.4
diff -u -r1.4 map.c
--- tset/map.c	3 Nov 2003 19:31:33 -0000	1.4
+++ tset/map.c	29 Aug 2004 21:27:19 -0000
@@ -130,7 +130,7 @@
 			goto badmopt;
 		++arg;
 	} else {				/* Optional baudrate. */
-		arg = index(p = arg, ':');
+		arg = strchr(p = arg, ':');
 		if (arg == NULL)
 			goto badmopt;
 		*arg++ = '\0';
Index: tset/term.c
===================================================================
RCS file: /cvs/src/usr.bin/tset/term.c,v
retrieving revision 1.3
diff -u -r1.3 term.c
--- tset/term.c	4 Oct 2003 20:36:53 -0000	1.3
+++ tset/term.c	29 Aug 2004 21:27:19 -0000
@@ -72,7 +72,7 @@
 
 	/* Try ttyname(3); check for dialup or other mapping. */
 	if ((ttypath = ttyname(STDERR_FILENO))) {
-		if ((p = rindex(ttypath, '/')))
+		if ((p = strrchr(ttypath, '/')))
 			++p;
 		else
 			p = ttypath;
@@ -144,7 +144,7 @@
 			return (dflt);
 		}
 
-		if ((p = index(answer, '\n')))
+		if ((p = strchr(answer, '\n')))
 			*p = '\0';
 		if (answer[0])
 			return (answer);
Index: tset/wrterm.c
===================================================================
RCS file: /cvs/src/usr.bin/tset/wrterm.c,v
retrieving revision 1.3
diff -u -r1.3 wrterm.c
--- tset/wrterm.c	4 Oct 2003 20:36:53 -0000	1.3
+++ tset/wrterm.c	29 Aug 2004 21:27:19 -0000
@@ -54,7 +54,7 @@
 	char *t, *sep;
 
 	/* Find the end of the terminal names. */
-	if ((t = index(bp, ':')) == NULL)
+	if ((t = strchr(bp, ':')) == NULL)
 		errx(1, "termcap names not colon terminated");
 	*t++ = '\0';
 
Index: window/lcmd1.c
===================================================================
RCS file: /cvs/src/usr.bin/window/lcmd1.c,v
retrieving revision 1.2
diff -u -r1.2 lcmd1.c
--- window/lcmd1.c	17 Jun 2003 04:29:34 -0000	1.2
+++ window/lcmd1.c	29 Aug 2004 21:27:20 -0000
@@ -102,7 +102,7 @@
 			*pp = a->v_str;
 		*pp = 0;
 		shf = *(sh = argv);
-		if (*sh = rindex(shf, '/'))
+		if (*sh = strrchr(shf, '/'))
 			(*sh)++;
 		else
 			*sh = shf;
Index: window/lcmd2.c
===================================================================
RCS file: /cvs/src/usr.bin/window/lcmd2.c,v
retrieving revision 1.2
diff -u -r1.2 lcmd2.c
--- window/lcmd2.c	17 Jun 2003 04:29:34 -0000	1.2
+++ window/lcmd2.c	29 Aug 2004 21:27:20 -0000
@@ -282,7 +282,7 @@
 			break;
 		}
 	if (default_shellfile = *default_shell)
-		if (*default_shell = rindex(default_shellfile, '/'))
+		if (*default_shell = strrchr(default_shellfile, '/'))
 			(*default_shell)++;
 		else
 			*default_shell = default_shellfile;
Index: window/main.c
===================================================================
RCS file: /cvs/src/usr.bin/window/main.c,v
retrieving revision 1.2
diff -u -r1.2 main.c
--- window/main.c	17 Jun 2003 04:29:34 -0000	1.2
+++ window/main.c	29 Aug 2004 21:27:20 -0000
@@ -62,7 +62,7 @@
 	char tflag = 0;
 
 	escapec = ESCAPEC;
-	if (p = rindex(*argv, '/'))
+	if (p = strrchr(*argv, '/'))
 		p++;
 	else
 		p = *argv;
@@ -108,7 +108,7 @@
 		(void) fprintf(stderr, "Out of memory.\n");
 		exit(1);
 	}
-	if (p = rindex(default_shellfile, '/'))
+	if (p = strrchr(default_shellfile, '/'))
 		p++;
 	else
 		p = default_shellfile;
Index: window/ww.h
===================================================================
RCS file: /cvs/src/usr.bin/window/ww.h,v
retrieving revision 1.2
diff -u -r1.2 ww.h
--- window/ww.h	17 Jun 2003 04:29:34 -0000	1.2
+++ window/ww.h	29 Aug 2004 21:27:20 -0000
@@ -311,7 +311,7 @@
 	/* c library functions */
 char *getenv();
 char *tgetstr();
-char *rindex();
+char *strrchr();
 char *strcpy();
 char *strcat();
 
Index: write/write.c
===================================================================
RCS file: /cvs/src/usr.bin/write/write.c,v
retrieving revision 1.3
diff -u -r1.3 write.c
--- write/write.c	4 Oct 2003 20:36:55 -0000	1.3
+++ write/write.c	29 Aug 2004 21:27:20 -0000
@@ -84,7 +84,7 @@
 		errx(1, "can't find your tty");
 	if (!(mytty = ttyname(myttyfd)))
 		errx(1, "can't find your tty's name");
-	if ((cp = rindex(mytty, '/')))
+	if ((cp = strrchr(mytty, '/')))
 		mytty = cp + 1;
 	if (term_chk(mytty, &msgsok, &atime, 1))
 		exit(1);
