#define _GNU_SOURCE #include 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; } #ifdef TEST int main(void) { return 0; } #endif