1/* Compliments of Jay Freeman <saurik@saurik.com> */ 2 3#ifdef HAVE_CONFIG_H 4# include "config.h" 5#endif 6 7#include <string.h> 8 9#if !HAVE_STRSEP 10char *strsep(char **stringp, const char *delim) { 11 char *ret = *stringp; 12 if (ret == NULL) return(NULL); /* grrr */ 13 if ((*stringp = strpbrk(*stringp, delim)) != NULL) { 14 *((*stringp)++) = '\0'; 15 } 16 return(ret); 17} 18#endif /* !HAVE_STRSEP */ 19