source:
trunk/sys/dietlibc/strsep.c
@
397
Last change on this file since 397 was 1, checked in by , 8 years ago | |
---|---|
File size: 386 bytes |
Rev | Line | |
---|---|---|
[1] | 1 | #include <string.h> |
2 | ||
3 | char *strsep(char **stringp, const char *delim) { | |
4 | register char *tmp=*stringp; | |
5 | register char *tmp2=tmp; | |
6 | register const char *tmp3; | |
7 | if (!*stringp) return 0; | |
8 | for (tmp2=tmp; *tmp2; ++tmp2) { | |
9 | for (tmp3=delim; *tmp3; ++tmp3) | |
10 | if (*tmp2==*tmp3) { /* delimiter found */ | |
11 | *tmp2=0; | |
12 | *stringp=tmp2+1; | |
13 | return tmp; | |
14 | } | |
15 | } | |
16 | *stringp=0; | |
17 | return tmp; | |
18 | } |
Note: See TracBrowser
for help on using the repository browser.