# HG changeset patch # User Richard Laager # Date 1183254117 0 # Node ID 16bdcffb1c6295d2e05acf9b03b0613514363705 # Parent e122b631a657bf5b73c787ee21b07b6d718bfe6d Use the glib strcasecmp functions everywhere, as we've had reports of problems on Windows (with Visual Studio) and the Maemo platform. This way we don't need to worry about where to include . diff -r e122b631a657 -r 16bdcffb1c62 libpurple/plugins/filectl.c --- a/libpurple/plugins/filectl.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/plugins/filectl.c Sun Jul 01 01:41:57 2007 +0000 @@ -56,7 +56,7 @@ purple_debug_misc("filectl", "read: %s\n", buffer); command = getarg(buffer, 0, 0); - if (!strncasecmp(command, "login", 6)) { + if (!g_ascii_strncasecmp(command, "login", 6)) { PurpleAccount *account; arg1 = getarg(buffer, 1, 0); @@ -69,7 +69,7 @@ free(arg1); free(arg2); - } else if (!strncasecmp(command, "logout", 7)) { + } else if (!g_ascii_strncasecmp(command, "logout", 7)) { PurpleAccount *account; arg1 = getarg(buffer, 1, 1); @@ -88,7 +88,7 @@ /* purple_find_conversation() is gone in 2.0.0. */ #if 0 - } else if (!strncasecmp(command, "send", 4)) { + } else if (!g_ascii_strncasecmp(command, "send", 4)) { PurpleConversation *conv; arg1 = getarg(buffer, 1, 0); @@ -107,21 +107,21 @@ free(arg2); #endif - } else if (!strncasecmp(command, "away", 4)) { + } else if (!g_ascii_strncasecmp(command, "away", 4)) { arg1 = getarg(buffer, 1, 1); /* serv_set_away_all(arg1); */ free(arg1); - } else if (!strncasecmp(command, "hide", 4)) { + } else if (!g_ascii_strncasecmp(command, "hide", 4)) { purple_blist_set_visible(FALSE); - } else if (!strncasecmp(command, "unhide", 6)) { + } else if (!g_ascii_strncasecmp(command, "unhide", 6)) { purple_blist_set_visible(TRUE); - } else if (!strncasecmp(command, "back", 4)) { + } else if (!g_ascii_strncasecmp(command, "back", 4)) { /* do_im_back(); */ - } else if (!strncasecmp(command, "quit", 4)) { + } else if (!g_ascii_strncasecmp(command, "quit", 4)) { purple_core_quit(); } diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/gg/lib/http.c --- a/libpurple/protocols/gg/lib/http.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/gg/lib/http.c Sun Jul 01 01:41:57 2007 +0000 @@ -349,7 +349,7 @@ gg_debug(GG_DEBUG_MISC, "=> -----BEGIN-HTTP-HEADER-----\n%s\n=> -----END-HTTP-HEADER-----\n", h->header); while (line) { - if (!strncasecmp(line, "Content-length: ", 16)) { + if (!g_ascii_strncasecmp(line, "Content-length: ", 16)) { h->body_size = atoi(line + 16); } line = strchr(line, '\n'); diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/gg/lib/pubdir50.c --- a/libpurple/protocols/gg/lib/pubdir50.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/gg/lib/pubdir50.c Sun Jul 01 01:41:57 2007 +0000 @@ -347,7 +347,7 @@ /* jeśli dostaliśmy namier na następne wyniki, to znaczy że * mamy koniec wyników i nie jest to kolejna osoba. */ - if (!strcasecmp(field, "nextstart")) { + if (!g_ascii_strcasecmp(field, "nextstart")) { res->next = atoi(value); num--; } else { @@ -390,7 +390,7 @@ } for (i = 0; i < res->entries_count; i++) { - if (res->entries[i].num == num && !strcasecmp(res->entries[i].field, field)) { + if (res->entries[i].num == num && !g_ascii_strcasecmp(res->entries[i].field, field)) { value = res->entries[i].value; break; } diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/msn/msn-utils.c --- a/libpurple/protocols/msn/msn-utils.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/msn/msn-utils.c Sun Jul 01 01:41:57 2007 +0000 @@ -296,7 +296,7 @@ char *attr_dir; attributes = g_strndup(c, attr_len); attr_dir = purple_markup_get_css_property(attributes, "direction"); - if (attr_dir && (!strncasecmp(attr_dir, "RTL", 3))) + if (attr_dir && (!g_ascii_strncasecmp(attr_dir, "RTL", 3))) direction = '1'; g_free(attr_dir); g_free(attributes); diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/oscar/odc.c --- a/libpurple/protocols/oscar/odc.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/oscar/odc.c Sun Jul 01 01:41:57 2007 +0000 @@ -314,7 +314,7 @@ tmp += size; /* Skip past the closing tag */ - if (strncasecmp(tmp, "", 7)) + if (g_ascii_strncasecmp(tmp, "", 7)) { g_free(embedded_data); break; diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/silc/buddy.c --- a/libpurple/protocols/silc/buddy.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/silc/buddy.c Sun Jul 01 01:41:57 2007 +0000 @@ -1252,7 +1252,7 @@ SilcClientEntry entry; silc_dlist_start(clients); while ((entry = silc_dlist_get(clients))) { - if (!strncasecmp(b->name, entry->nickname, + if (!g_ascii_strncasecmp(b->name, entry->nickname, strlen(b->name))) { client_entry = entry; break; diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/silc/util.c --- a/libpurple/protocols/silc/util.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/silc/util.c Sun Jul 01 01:41:57 2007 +0000 @@ -623,15 +623,15 @@ ct = strrchr(filename, '.'); if (!ct) return NULL; - else if (!strcasecmp(".png", ct)) + else if (!g_ascii_strcasecmp(".png", ct)) return strdup("image/png"); - else if (!strcasecmp(".jpg", ct)) + else if (!g_ascii_strcasecmp(".jpg", ct)) return strdup("image/jpeg"); - else if (!strcasecmp(".jpeg", ct)) + else if (!g_ascii_strcasecmp(".jpeg", ct)) return strdup("image/jpeg"); - else if (!strcasecmp(".gif", ct)) + else if (!g_ascii_strcasecmp(".gif", ct)) return strdup("image/gif"); - else if (!strcasecmp(".tiff", ct)) + else if (!g_ascii_strcasecmp(".tiff", ct)) return strdup("image/tiff"); return NULL; diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/silc10/buddy.c --- a/libpurple/protocols/silc10/buddy.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/silc10/buddy.c Sun Jul 01 01:41:57 2007 +0000 @@ -1246,7 +1246,7 @@ buddy nickname. */ int i; for (i = 0; i < clients_count; i++) { - if (!strncasecmp(b->name, clients[i]->nickname, + if (!g_ascii_strncasecmp(b->name, clients[i]->nickname, strlen(b->name))) { clients[0] = clients[i]; break; diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/simple/simple.c --- a/libpurple/protocols/simple/simple.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/simple/simple.c Sun Jul 01 01:41:57 2007 +0000 @@ -337,7 +337,7 @@ return; } - if(!g_strncasecmp(hdr, "NTLM", 4)) { + if(!g_ascii_strncasecmp(hdr, "NTLM", 4)) { purple_debug_info("simple", "found NTLM\n"); auth->type = 2; parts = g_strsplit(hdr+5, "\", ", 0); diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/yahoo/yahoo_picture.c --- a/libpurple/protocols/yahoo/yahoo_picture.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_picture.c Sun Jul 01 01:41:57 2007 +0000 @@ -110,7 +110,7 @@ } /* Yahoo IM 6 spits out 0.png as the URL if the buddy icon is not set */ - if (who && got_icon_info && url && !strncasecmp(url, "http://", 7)) { + if (who && got_icon_info && url && !g_ascii_strncasecmp(url, "http://", 7)) { /* TODO: make this work p2p, try p2p before the url */ PurpleUtilFetchUrlData *url_data; struct yahoo_fetch_picture_data *data; diff -r e122b631a657 -r 16bdcffb1c62 libpurple/protocols/zephyr/ZVariables.c --- a/libpurple/protocols/zephyr/ZVariables.c Sun Jul 01 01:25:02 2007 +0000 +++ b/libpurple/protocols/zephyr/ZVariables.c Sun Jul 01 01:41:57 2007 +0000 @@ -186,7 +186,7 @@ #define max(a,b) ((a > b) ? (a) : (b)) #endif - if (strncasecmp(bfr, var, max(strlen(var),cp - bfr))) + if (g_strncasecmp(bfr, var, max(strlen(var), cp - bfr))) return(0); /* var is not the var in bfr ==> no match */ diff -r e122b631a657 -r 16bdcffb1c62 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Sun Jul 01 01:25:02 2007 +0000 +++ b/pidgin/gtkimhtml.c Sun Jul 01 01:41:57 2007 +0000 @@ -2162,7 +2162,7 @@ gint i; for(i=0; i #include -#ifndef _WIN32 -#include -#endif #include #include @@ -1787,19 +1784,19 @@ while (buf_get_line(ibuf, &buf, &pnt, size)) { if (*buf != '#') { - if (!strncasecmp(buf, "BAD ", 4)) + if (!g_ascii_strncasecmp(buf, "BAD ", 4)) { strncpy(bad, buf + 4, 81); } - else if(!strncasecmp(buf, "CASE ", 5)) + else if(!g_ascii_strncasecmp(buf, "CASE ", 5)) { case_sensitive = *(buf+5) == '0' ? FALSE : TRUE; } - else if(!strncasecmp(buf, "COMPLETE ", 9)) + else if(!g_ascii_strncasecmp(buf, "COMPLETE ", 9)) { complete = *(buf+9) == '0' ? FALSE : TRUE; } - else if (!strncasecmp(buf, "GOOD ", 5)) + else if (!g_ascii_strncasecmp(buf, "GOOD ", 5)) { strncpy(good, buf + 5, 255);