Mercurial > pidgin.yaz
changeset 18397:e122b631a657
Replace some strncasecmp() calls with g_ascii_strncasecmp() as part of the
effort to make libpurple compile with Visual Studio. --rlaager
committer: Richard Laager <rlaager@wiktel.com>
author | Nick Hebner <hebnern@gmail.com> |
---|---|
date | Sun, 01 Jul 2007 01:25:02 +0000 |
parents | 864c454a5e16 |
children | 16bdcffb1c62 |
files | libpurple/util.c |
diffstat | 1 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/util.c Sun Jul 01 01:15:09 2007 +0000 +++ b/libpurple/util.c Sun Jul 01 01:25:02 2007 +0000 @@ -1730,7 +1730,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; @@ -1738,12 +1738,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; @@ -1771,7 +1771,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 [ */ @@ -1780,7 +1780,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] == '\'') @@ -1812,7 +1812,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); @@ -1834,29 +1834,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>"; } @@ -3079,7 +3079,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 { @@ -3093,7 +3093,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;