about summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2017-02-06 18:14:16 +0000
committerWilco Dijkstra <wdijkstr@arm.com>2017-02-06 18:15:18 +0000
commitc7a37ad352c90d798d138b9f83e0333c78d08410 (patch)
treee6946eed9f90ca89dd2660a8f1360961cffc9eb5 /misc
parent5a68e857bf1b64c2576bbf32429aed5162e90bb9 (diff)
downloadglibc-c7a37ad352c90d798d138b9f83e0333c78d08410.tar.gz
glibc-c7a37ad352c90d798d138b9f83e0333c78d08410.tar.xz
glibc-c7a37ad352c90d798d138b9f83e0333c78d08410.zip
As a minor cleanup remove the (r)index defines from include/string.h as
they are only used internally in a few places.  Rename all uses that
occur in GLIBC.

	* hurd/path-lookup.c (file_name_path_scan): Rename index to strchr.
	* include/string.h (index): Remove define.
	(rindex): Likewise.
	* misc/getttyent.c (__getttyent): Rename index to strchr.
	* misc/ttyslot.c (ttyslot): Rename rindex to strrchr.
	* sunrpc/rpc_main.c (mkfile_output): Likewise.
Diffstat (limited to 'misc')
-rw-r--r--misc/getttyent.c6
-rw-r--r--misc/ttyslot.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/misc/getttyent.c b/misc/getttyent.c
index d2af870123..73002f52d1 100644
--- a/misc/getttyent.c
+++ b/misc/getttyent.c
@@ -78,7 +78,7 @@ __getttyent (void)
 			return (NULL);
 		}
 		/* skip lines that are too big */
-		if (!index(p, '\n')) {
+		if (!strchr (p, '\n')) {
 			while ((c = getc_unlocked(tf)) != '\n' && c != EOF)
 				;
 			continue;
@@ -127,7 +127,7 @@ __getttyent (void)
 	tty.ty_comment = p;
 	if (*p == 0)
 		tty.ty_comment = 0;
-	if ((p = index(p, '\n')))
+	if ((p = strchr (p, '\n')))
 		*p = '\0';
 	return (&tty);
 }
@@ -179,7 +179,7 @@ internal_function
 value (char *p)
 {
 
-	return ((p = index(p, '=')) ? ++p : NULL);
+	return ((p = strchr (p, '=')) ? ++p : NULL);
 }
 
 int
diff --git a/misc/ttyslot.c b/misc/ttyslot.c
index 0ed14d73ea..2f3c7953d7 100644
--- a/misc/ttyslot.c
+++ b/misc/ttyslot.c
@@ -56,7 +56,7 @@ ttyslot (void)
 	__setttyent();
 	for (cnt = 0; cnt < 3; ++cnt)
 		if (__ttyname_r (cnt, name, buflen) == 0) {
-			if ((p = rindex(name, '/')))
+			if ((p = strrchr (name, '/')))
 				++p;
 			else
 				p = name;