This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.25-11-gc7a37ad


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  c7a37ad352c90d798d138b9f83e0333c78d08410 (commit)
      from  5a68e857bf1b64c2576bbf32429aed5162e90bb9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c7a37ad352c90d798d138b9f83e0333c78d08410

commit c7a37ad352c90d798d138b9f83e0333c78d08410
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date:   Mon Feb 6 18:14:16 2017 +0000

    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.

diff --git a/ChangeLog b/ChangeLog
index db64d85..d058211 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-02-06  Wilco Dijkstra  <wdijkstr@arm.com>
+
+	* 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.
+
 2017-02-06  Joseph Myers  <joseph@codesourcery.com>
 
 	* math/libm-test-driver.c: New file.  Based on math/libm-test.inc.
diff --git a/hurd/path-lookup.c b/hurd/path-lookup.c
index d79a482..f2061b0 100644
--- a/hurd/path-lookup.c
+++ b/hurd/path-lookup.c
@@ -33,7 +33,7 @@ file_name_path_scan (const char *file_name, const char *path,
 		     error_t (*fun)(const char *name),
 		     char **prefixed_name)
 {
-  if (path == NULL || index (file_name, '/'))
+  if (path == NULL || strchr (file_name, '/'))
     {
       if (prefixed_name)
 	*prefixed_name = 0;
@@ -47,7 +47,7 @@ file_name_path_scan (const char *file_name, const char *path,
       for (;;)
 	{
 	  error_t err;
-	  const char *next = index (path, ':') ?: path + strlen (path);
+	  const char *next = strchr (path, ':') ?: path + strlen (path);
 	  size_t pfx_len = next - path;
 	  char pfxed_name[pfx_len + 2 + file_name_len + 1];
 
diff --git a/include/string.h b/include/string.h
index 300a2e2..07389f3 100644
--- a/include/string.h
+++ b/include/string.h
@@ -160,15 +160,6 @@ extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy");
 extern __typeof (stpcpy) stpcpy __asm__ ("__stpcpy");
 #endif
 
-# ifndef _ISOMAC
-#  ifndef index
-#   define index(s, c)	(strchr ((s), (c)))
-#  endif
-#  ifndef rindex
-#   define rindex(s, c)	(strrchr ((s), (c)))
-#  endif
-# endif
-
 extern void *__memcpy_chk (void *__restrict __dest,
 			   const void *__restrict __src, size_t __len,
 			   size_t __destlen) __THROW;
diff --git a/misc/getttyent.c b/misc/getttyent.c
index d2af870..73002f5 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 0ed14d7..2f3c795 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;
diff --git a/sunrpc/rpc_main.c b/sunrpc/rpc_main.c
index 0a51e2c..f94bc91 100644
--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -956,7 +956,7 @@ mkfile_output (struct commandline *cmd)
       mkfilename = alloc (strlen ("Makefile.") + strlen (cmd->infile) + 1);
       if (mkfilename == NULL)
 	abort ();
-      temp = rindex (cmd->infile, '.');
+      temp = strrchr (cmd->infile, '.');
       cp = stpcpy (mkfilename, "Makefile.");
       if (temp != NULL)
 	*((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    9 +++++++++
 hurd/path-lookup.c |    4 ++--
 include/string.h   |    9 ---------
 misc/getttyent.c   |    6 +++---
 misc/ttyslot.c     |    2 +-
 sunrpc/rpc_main.c  |    2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]