summaryrefslogtreecommitdiff
path: root/util/strsep.c
blob: e3592c2a3ab13ced53fb986cece9a1c7d8b6b07e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifdef NEED_STRSEP

#include <string.h>

char *strsep(char **stringp, const char *delim)
{
	char *ret = *stringp;
	if (ret == NULL) return NULL;
	if ((*stringp = strpbrk(*stringp, delim)) != NULL)
		*((*stringp)++) = '\0';
	return ret;
}

#endif