From ec91d8b59d5c8b314bc50cc6feedeeaf6fe3493c Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Wed, 23 Aug 2006 03:38:46 +0000 Subject: Merge from trunk. --- libc/string/generic/strtok_r.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libc/string/generic/strtok_r.c') diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c index 0ab18b35e..bae394a80 100644 --- a/libc/string/generic/strtok_r.c +++ b/libc/string/generic/strtok_r.c @@ -22,7 +22,13 @@ libc_hidden_proto(strtok_r) libc_hidden_proto(strspn) libc_hidden_proto(strpbrk) +#ifdef __USE_GNU +# define __rawmemchr rawmemchr libc_hidden_proto(rawmemchr) +#else +# define __rawmemchr strchr +libc_hidden_proto(strchr) +#endif /* Parse S into tokens separated by characters in DELIM. If S is NULL, the saved pointer in SAVE_PTR is used as @@ -54,7 +60,7 @@ char *strtok_r (char *s, const char *delim, char **save_ptr) s = strpbrk (token, delim); if (s == NULL) /* This token finishes the string. */ - *save_ptr = rawmemchr (token, '\0'); + *save_ptr = __rawmemchr (token, '\0'); else { /* Terminate the token and make *SAVE_PTR point past it. */ -- cgit v1.2.3