blob: 1bfe1db1cc23bc666c667e27d7f5760ca99f79b2 (
plain) (
tree)
|
|
#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;
}
|