From 63b80e79f69beec9a375f53d5cd8f20f55fb4746 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 14 Apr 2010 06:59:56 +0200 Subject: win32: add strsep() --- win32/mingw.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'win32') diff --git a/win32/mingw.c b/win32/mingw.c index eccd37cc3..937e9422c 100644 --- a/win32/mingw.c +++ b/win32/mingw.c @@ -348,3 +348,21 @@ int link(const char *oldpath, const char *newpath) } return 0; } + +char *strsep(char **stringp, const char *delim) +{ + char *s, *old_stringp; + if (!*stringp) + return NULL; + old_stringp = s = *stringp; + while (*s) { + if (strchr(delim, *s)) { + *s = '\0'; + *stringp = s+1; + return old_stringp; + } + s++; + } + *stringp = NULL; + return old_stringp; +} -- cgit v1.2.3-55-g6feb