2004-01-13 04:29:30 +00:00
|
|
|
/* Compliments of Jay Freeman <saurik@saurik.com> */
|
|
|
|
|
2004-03-16 05:24:54 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2004-01-13 04:29:30 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2004-03-16 05:24:54 +00:00
|
|
|
#if !HAVE_STRSEP
|
2004-01-13 04:29:30 +00:00
|
|
|
char *strsep(char **stringp, const char *delim) {
|
2006-02-26 08:46:24 +00:00
|
|
|
char *ret = *stringp;
|
|
|
|
if (ret == NULL) return(NULL); /* grrr */
|
|
|
|
if ((*stringp = strpbrk(*stringp, delim)) != NULL) {
|
|
|
|
*((*stringp)++) = '\0';
|
|
|
|
}
|
|
|
|
return(ret);
|
2004-01-13 04:29:30 +00:00
|
|
|
}
|
2004-03-16 05:24:54 +00:00
|
|
|
#endif /* !HAVE_STRSEP */
|