URL
https://opencores.org/ocsvn/hf-risc/hf-risc/trunk
Subversion Repositories hf-risc
Compare Revisions
- This comparison shows the changes necessary to convert path
/hf-risc/trunk/software
- from Rev 14 to Rev 16
- ↔ Reverse comparison
Rev 14 → Rev 16
/lib/libc.c
193,10 → 193,11
|
int8_t *strstr(const int8_t *string, const int8_t *find){ |
int32_t i; |
|
for(;;){ |
for(i = 0; string[i] == find[i] && find[i]; ++i); |
if(find[i] == 0) |
return (char*)string; |
return (char *)string; |
if(*string++ == 0) |
return NULL; |
} |
221,13 → 222,17
} |
|
int8_t *strpbrk(int8_t *str, int8_t *set){ |
while (*str != '\0'){ |
if (strchr(set, *str) == 0) |
++str; |
else |
return (int8_t *) str; |
return 0; |
int8_t c, *p; |
|
for (c = *str; c != 0; str++, c = *str) { |
for (p = set; *p != 0; p++) { |
if (c == *p) { |
return str; |
} |
} |
} |
return 0; |
|
} |
|
int8_t *strsep(int8_t **pp, int8_t *delim){ |
235,7 → 240,7
|
if (!(p = *pp)) |
return 0; |
if (q = strpbrk (p, delim)){ |
if ((q = strpbrk (p, delim))){ |
*pp = q + 1; |
*q = '\0'; |
}else *pp = 0; |