Mercurial > pidgin.yaz
diff libpurple/util.c @ 25526:162a767a20d4
propagate from branch 'im.pidgin.pidgin' (head 414f0770611139752d484f4831cb59038456c9bf)
to branch 'im.pidgin.pidgin.yaz' (head 14b9a68d9ec80c997ca0986d8626805b8e347174)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sun, 01 Jul 2007 08:41:01 +0000 |
parents | db41905e7cc4 e122b631a657 |
children | d679ee8062bf |
line wrap: on
line diff
--- a/libpurple/util.c Fri Jun 29 13:52:07 2007 +0000 +++ b/libpurple/util.c Sun Jul 01 08:41:01 2007 +0000 @@ -1732,7 +1732,7 @@ if (cdata_close_tag) { /* Note: Don't even assume any other tag is a tag in CDATA */ - if (strncasecmp(str2 + i, cdata_close_tag, + if (g_ascii_strncasecmp(str2 + i, cdata_close_tag, strlen(cdata_close_tag)) == 0) { i += strlen(cdata_close_tag) - 1; @@ -1740,12 +1740,12 @@ } continue; } - else if (strncasecmp(str2 + i, "<td", 3) == 0 && closing_td_p) + else if (g_ascii_strncasecmp(str2 + i, "<td", 3) == 0 && closing_td_p) { str2[j++] = '\t'; visible = TRUE; } - else if (strncasecmp(str2 + i, "</td>", 5) == 0) + else if (g_ascii_strncasecmp(str2 + i, "</td>", 5) == 0) { closing_td_p = TRUE; visible = FALSE; @@ -1773,7 +1773,7 @@ /* If we've got an <a> tag with an href, save the address * to print later. */ - if (strncasecmp(str2 + i, "<a", 2) == 0 && + if (g_ascii_strncasecmp(str2 + i, "<a", 2) == 0 && g_ascii_isspace(str2[i+2])) { int st; /* start of href, inclusive [ */ @@ -1782,7 +1782,7 @@ /* Find start of href */ for (st = i + 3; st < k; st++) { - if (strncasecmp(str2+st, "href=", 5) == 0) + if (g_ascii_strncasecmp(str2+st, "href=", 5) == 0) { st += 5; if (str2[st] == '"' || str2[st] == '\'') @@ -1814,7 +1814,7 @@ /* Replace </a> with an ascii representation of the * address the link was pointing to. */ - else if (href != NULL && strncasecmp(str2 + i, "</a>", 4) == 0) + else if (href != NULL && g_ascii_strncasecmp(str2 + i, "</a>", 4) == 0) { size_t hrlen = strlen(href); @@ -1836,29 +1836,29 @@ } /* Check for tags which should be mapped to newline */ - else if (strncasecmp(str2 + i, "<p>", 3) == 0 - || strncasecmp(str2 + i, "<tr", 3) == 0 - || strncasecmp(str2 + i, "<br", 3) == 0 - || strncasecmp(str2 + i, "<hr", 3) == 0 - || strncasecmp(str2 + i, "<li", 3) == 0 - || strncasecmp(str2 + i, "<div", 4) == 0 - || strncasecmp(str2 + i, "</table>", 8) == 0) + else if (g_ascii_strncasecmp(str2 + i, "<p>", 3) == 0 + || g_ascii_strncasecmp(str2 + i, "<tr", 3) == 0 + || g_ascii_strncasecmp(str2 + i, "<br", 3) == 0 + || g_ascii_strncasecmp(str2 + i, "<hr", 3) == 0 + || g_ascii_strncasecmp(str2 + i, "<li", 3) == 0 + || g_ascii_strncasecmp(str2 + i, "<div", 4) == 0 + || g_ascii_strncasecmp(str2 + i, "</table>", 8) == 0) { str2[j++] = '\n'; } /* Check for tags which begin CDATA and need to be closed */ #if 0 /* FIXME.. option is end tag optional, we can't handle this right now */ - else if (strncasecmp(str2 + i, "<option", 7) == 0) + else if (g_ascii_strncasecmp(str2 + i, "<option", 7) == 0) { /* FIXME: We should not do this if the OPTION is SELECT'd */ cdata_close_tag = "</option>"; } #endif - else if (strncasecmp(str2 + i, "<script", 7) == 0) + else if (g_ascii_strncasecmp(str2 + i, "<script", 7) == 0) { cdata_close_tag = "</script>"; } - else if (strncasecmp(str2 + i, "<style", 6) == 0) + else if (g_ascii_strncasecmp(str2 + i, "<style", 6) == 0) { cdata_close_tag = "</style>"; } @@ -3081,7 +3081,7 @@ i = 0; /* position in the source string */ j = 0; /* number of occurrences of "delimiter" */ while (string[i] != '\0') { - if (!strncasecmp(&string[i], delimiter, length_del)) { + if (!g_ascii_strncasecmp(&string[i], delimiter, length_del)) { i += length_del; j += length_rep; } else { @@ -3095,7 +3095,7 @@ i = 0; /* position in the source string */ j = 0; /* position in the destination string */ while (string[i] != '\0') { - if (!strncasecmp(&string[i], delimiter, length_del)) { + if (!g_ascii_strncasecmp(&string[i], delimiter, length_del)) { strncpy(&ret[j], replacement, length_rep); i += length_del; j += length_rep;