source: trunk/sys/dietlibc/strtok_r.c @ 79

Last change on this file since 79 was 1, checked in by alain, 8 years ago

First import

File size: 306 bytes
Line 
1#include <string.h>
2
3char*strtok_r(char*s,const char*delim,char**ptrptr) {
4  char*tmp=0;
5
6  if (s==0) s=*ptrptr;
7  s+=strspn(s,delim);           /* overread leading delimiter */
8  if (*s) {
9    tmp=s;
10    s+=strcspn(s,delim);
11    if (*s) *s++=0;     /* not the end ? => terminate it */
12  }
13  *ptrptr=s;
14  return tmp;
15}
Note: See TracBrowser for help on using the repository browser.