1 /* Compliments of Jay Freeman <saurik@saurik.com> */ 2 3 #include <string.h> 4 5 char *strsep(char **stringp, const char *delim) { 6 char *ret = *stringp; 7 if (ret == NULL) return(NULL); /* grrr */ 8 if ((*stringp = strpbrk(*stringp, delim)) != NULL) { 9 *((*stringp)++) = '\0'; 10 } 11 return(ret); 12 } |