aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
Diffstat (limited to 'string')
-rw-r--r--string/bcopy.c2
-rw-r--r--string/strcspn.c21
-rw-r--r--string/strpbrk.c16
-rw-r--r--string/strrchr.c6
-rw-r--r--string/strspn.c7
5 files changed, 22 insertions, 30 deletions
diff --git a/string/bcopy.c b/string/bcopy.c
index 7c1225c4d7..f497b5d44c 100644
--- a/string/bcopy.c
+++ b/string/bcopy.c
@@ -25,4 +25,4 @@
#define a2 dest
#define a2const
-#include <memmove.c>
+#include <string/memmove.c>
diff --git a/string/strcspn.c b/string/strcspn.c
index 7c39f793ea..431620521a 100644
--- a/string/strcspn.c
+++ b/string/strcspn.c
@@ -15,27 +15,18 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined _LIBC || HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef strchr
-# define strchr index
-# endif
-#endif
+#include <string.h>
#undef strcspn
+#ifndef STRCSPN
+# define STRCSPN strcspn
+#endif
+
/* Return the length of the maximum initial segment of S
which contains no characters from REJECT. */
size_t
-strcspn (s, reject)
- const char *s;
- const char *reject;
+STRCSPN (const char *s, const char *reject)
{
size_t count = 0;
diff --git a/string/strpbrk.c b/string/strpbrk.c
index ce33b684ef..a694242161 100644
--- a/string/strpbrk.c
+++ b/string/strpbrk.c
@@ -15,21 +15,17 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined _LIBC || defined HAVE_CONFIG_H
-# include <string.h>
-#endif
+#include <string.h>
#undef strpbrk
+#ifndef STRPBRK
+#define STRPBRK strpbrk
+#endif
+
/* Find the first occurrence in S of any character in ACCEPT. */
char *
-strpbrk (s, accept)
- const char *s;
- const char *accept;
+STRPBRK (const char *s, const char *accept)
{
while (*s != '\0')
{
diff --git a/string/strrchr.c b/string/strrchr.c
index b5b4bc6208..47ff08cfa3 100644
--- a/string/strrchr.c
+++ b/string/strrchr.c
@@ -19,9 +19,13 @@
#undef strrchr
+#ifndef STRRCHR
+# define STRRCHR strrchr
+#endif
+
/* Find the last occurrence of C in S. */
char *
-strrchr (const char *s, int c)
+STRRCHR (const char *s, int c)
{
const char *found, *p;
diff --git a/string/strspn.c b/string/strspn.c
index 37e8161a28..c2d6364752 100644
--- a/string/strspn.c
+++ b/string/strspn.c
@@ -18,13 +18,14 @@
#include <string.h>
#undef strspn
+#ifndef STRSPN
+#define STRSPN strspn
+#endif
/* Return the length of the maximum initial segment
of S which contains only characters in ACCEPT. */
size_t
-strspn (s, accept)
- const char *s;
- const char *accept;
+STRSPN (const char *s, const char *accept)
{
const char *p;
const char *a;