owntone-server/src/strsep.c

19 lines
383 B
C
Raw Normal View History

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