Files
musl/src/string/strsep.c

14 lines
222 B
C
Raw Normal View History

2011-04-06 14:28:29 -04:00
#define _GNU_SOURCE
2011-02-12 00:22:29 -05:00
#include <string.h>
char *strsep(char **str, const char *sep)
{
char *s = *str, *end;
if (!s) return NULL;
end = s + strcspn(s, sep);
if (*end) *end++ = 0;
else end = 0;
*str = end;
return s;
}