* Copyright (c) 1988 Regents of the University of California.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)strtok.c 5.7 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
register char *s
, *delim
;
if (s
== NULL
&& (s
= last
) == NULL
)
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
for (spanp
= delim
; (sc
= *spanp
++) != 0;) {
if (c
== 0) { /* no non-delimiter characters */
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
if ((sc
= *spanp
++) == c
) {