Diff for libcfg+/src/platon/str/strplus.c between version 1.26 and 1.27
| version 1.26, 2003/05/08 23:48:55 |
version 1.27, 2003/09/24 16:51:56 |
| Line 32 PLATON_FUNC(stristr)(s1, s2) |
|
| Line 32 PLATON_FUNC(stristr)(s1, s2) |
|
| const char *s2; |
const char *s2; |
| { |
{ |
| char *a_s1, *a_s2; |
char *a_s1, *a_s2; |
| register char *ret; |
register char *ret = NULL; |
| |
|
| a_s1 = strdup(s1); |
a_s1 = strdup(s1); |
| a_s2 = strdup(s2); |
a_s2 = strdup(s2); |
| |
|
| if (a_s1 == NULL) { |
if (a_s1 != NULL && a_s2 != NULL) { |
| free(a_s1); |
ret = strstr(PLATON_FUNC(strtolower)(a_s1), |
| return NULL; |
PLATON_FUNC(strtolower)(a_s2)); |
| |
if (ret != NULL) |
| |
ret = (char *) s1 + (ret - a_s1); |
| } |
} |
| |
|
| if (a_s2 == NULL) { |
if (a_s2 != NULL) |
| free(a_s2); |
free(a_s2); |
| return NULL; |
|
| } |
|
| |
|
| if ((ret = strstr(PLATON_FUNC(strtolower)(a_s1), |
if (a_s1 != NULL) |
| PLATON_FUNC(strtolower)(a_s2))) != NULL) |
free(a_s1); |
| ret = (char *) s1 + (ret - a_s1); |
|
| |
|
| free(a_s1); |
|
| free(a_s2); |
|
| |
|
| return ret; |
return ret; |
| } |
} |
Platon Group <platon@platon.org> http://platon.org/
|
|