aboutsummaryrefslogtreecommitdiff
path: root/system/lib/libc/musl/src/string/strsep.c
diff options
context:
space:
mode:
Diffstat (limited to 'system/lib/libc/musl/src/string/strsep.c')
-rw-r--r--system/lib/libc/musl/src/string/strsep.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/system/lib/libc/musl/src/string/strsep.c b/system/lib/libc/musl/src/string/strsep.c
new file mode 100644
index 00000000..cb37c32e
--- /dev/null
+++ b/system/lib/libc/musl/src/string/strsep.c
@@ -0,0 +1,13 @@
+#define _GNU_SOURCE
+#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;
+}