diff options
-rw-r--r-- | include/mingw.h | 2 | ||||
-rw-r--r-- | win32/mingw.c | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h index 40c11aabf..7fff1ad38 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -140,7 +140,7 @@ IMPL(unsetenv,void,,const char *env UNUSED_PARAM); | |||
140 | /* | 140 | /* |
141 | * string.h | 141 | * string.h |
142 | */ | 142 | */ |
143 | IMPL(strsep,char *,NULL,char **stringp UNUSED_PARAM, const char *delim UNUSED_PARAM); | 143 | char *strsep(char **stringp, const char *delim); |
144 | 144 | ||
145 | /* | 145 | /* |
146 | * sys/ioctl.h | 146 | * sys/ioctl.h |
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) | |||
348 | } | 348 | } |
349 | return 0; | 349 | return 0; |
350 | } | 350 | } |
351 | |||
352 | char *strsep(char **stringp, const char *delim) | ||
353 | { | ||
354 | char *s, *old_stringp; | ||
355 | if (!*stringp) | ||
356 | return NULL; | ||
357 | old_stringp = s = *stringp; | ||
358 | while (*s) { | ||
359 | if (strchr(delim, *s)) { | ||
360 | *s = '\0'; | ||
361 | *stringp = s+1; | ||
362 | return old_stringp; | ||
363 | } | ||
364 | s++; | ||
365 | } | ||
366 | *stringp = NULL; | ||
367 | return old_stringp; | ||
368 | } | ||