
/*--------------------------------------------------------
 *   Compilation instructions:
 *		$COMPILE:$ cc -c strtok.c ; lib foxlib-+strtok,,
 *--------------------------------------------------------*/

char *
strtok(str, delims)

char	*str,
		*delims;
{	static	char	*last_str;
	char	*cp = str ? str : last_str;

	if (cp == (char *) 0)
		return (char *) 0;

	while (*cp && strchr(delims, *cp))
		cp++;
	if (last_str = strpbrk(cp, delims))
		*last_str++ = (char *) 0;

	return *cp == (char *) 0 ? (char *) 0 : cp;
}
