X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;ds=sidebyside;f=libhb%2Fports.c;h=7e5421da1bdad7b2eacd64199d972b2add7fd3d8;hb=4b72a63eb61a01275493c4bfb51ba02152d1c5e1;hp=b29368e075b3a9002ea012170ba0db091041f658;hpb=2c55a7172bfed971b7255f93323950d23ab775cf;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/ports.c b/libhb/ports.c index b29368e0..7e5421da 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -747,3 +747,29 @@ void hb_net_close( hb_net_t ** _n ) *_n = NULL; } +#ifdef SYS_MINGW +char *strtok_r(char *s, const char *delim, char **save_ptr) +{ + char *token; + + if (s == NULL) s = *save_ptr; + + /* Scan leading delimiters. */ + s += strspn(s, delim); + if (*s == '\0') return NULL; + + /* Find the end of the token. */ + token = s; + s = strpbrk(token, delim); + if (s == NULL) + /* This token finishes the string. */ + *save_ptr = strchr(token, '\0'); + else { + /* Terminate the token and make *SAVE_PTR point past it. */ + *s = '\0'; + *save_ptr = s + 1; + } + + return token; +} +#endif