From 3451283511f4f60327720a3495c9dc918dea09e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 6 Oct 2004 00:14:41 +0000 Subject: [PATCH] Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9221 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/posix/string/strtok.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kernel/libroot/posix/string/strtok.c b/src/kernel/libroot/posix/string/strtok.c index 1db66098d9..8c50f3393c 100644 --- a/src/kernel/libroot/posix/string/strtok.c +++ b/src/kernel/libroot/posix/string/strtok.c @@ -3,11 +3,14 @@ ** Distributed under the terms of the NewOS License. */ + #include #include + static char *___strtok = NULL; + char * strtok_r(char *s, char const *ct, char **save_ptr) { @@ -17,15 +20,16 @@ strtok_r(char *s, char const *ct, char **save_ptr) return NULL; sbegin = s ? s : *save_ptr; - if (!sbegin) { + if (!sbegin) return NULL; - } - sbegin += strspn(sbegin,ct); + + sbegin += strspn(sbegin, ct); if (*sbegin == '\0') { if (save_ptr) *save_ptr = NULL; return NULL; } + send = strpbrk(sbegin, ct); if (send && *send != '\0') *send++ = '\0'; @@ -35,6 +39,7 @@ strtok_r(char *s, char const *ct, char **save_ptr) return sbegin; } + char * strtok(char *s, char const *ct) {