home *** CD-ROM | disk | FTP | other *** search
- #ifdef __STDC__
- static char sccs_id[] = "@(#) strtok.c 1.1 " __DATE__ " HJR";
- #else
- static char sccs_id[] = "@(#) strtok.c 1.1 26/9/90 HJR";
- #endif
-
- /* strtok.c (c) Copyright 1990 H.Rogers */
-
- #ifndef __STDC__
- #include "sys/types.h"
- #endif
- #include <string.h>
-
- #ifdef __STDC__
- char *
- strtok (register char *s1, register const char *s2)
- #else
- char *
- strtok (s1, s2)
- register char *s1;
- register const char *s2;
- #endif
- {
- static char *s;
-
- if (!s1)
- {
- if (!s)
- return (0);
- else
- s1 = s;
- }
-
- s1 += strspn (s1, s2);
-
- if (s = strpbrk (s1, s2))
- *s++ = 0;
-
- return (s1);
- }
-