diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 081137b8..111234e9 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -84,11 +84,11 @@ list_load_from_data (GSList ** list, char *ibuf, int size) { if (*buf != '#') { - if (!strncasecmp (buf, "NAME ", 5)) + if (!g_ascii_strncasecmp (buf, "NAME ", 5)) { safe_strcpy (name, buf + 5, sizeof (name)); } - else if (!strncasecmp (buf, "CMD ", 4)) + else if (!g_ascii_strncasecmp (buf, "CMD ", 4)) { safe_strcpy (cmd, buf + 4, sizeof (cmd)); if (*name) @@ -154,7 +154,7 @@ list_delentry (GSList ** list, char *name) while (alist) { pop = (struct popup *) alist->data; - if (!strcasecmp (name, pop->name)) + if (!g_ascii_strcasecmp (name, pop->name)) { *list = g_slist_remove (*list, pop); free (pop); @@ -174,7 +174,7 @@ cfg_get_str (char *cfg, char *var, char *dest, int dest_len) while (1) { - if (!strncasecmp (buffer, cfg, strlen (var) + 1)) + if (!g_ascii_strncasecmp (buffer, cfg, strlen (var) + 1)) { char *value, t; cfg += strlen (var); @@ -1000,7 +1000,7 @@ cfg_get_bool (char *var) do { - if (!strcasecmp (var, vars[i].name)) + if (!g_ascii_strcasecmp (var, vars[i].name)) { return *((int *) &prefs + vars[i].offset); } @@ -1023,27 +1023,27 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[]) int idx = 2; char *var, *val; - if (strcasecmp (word[2], "-e") == 0) + if (g_ascii_strcasecmp (word[2], "-e") == 0) { idx++; erase = TRUE; } /* turn a bit OFF */ - if (strcasecmp (word[idx], "-off") == 0) + if (g_ascii_strcasecmp (word[idx], "-off") == 0) { idx++; off = TRUE; } /* turn a bit ON */ - if (strcasecmp (word[idx], "-or") == 0 || strcasecmp (word[idx], "-on") == 0) + if (g_ascii_strcasecmp (word[idx], "-or") == 0 || g_ascii_strcasecmp (word[idx], "-on") == 0) { idx++; or = TRUE; } - if (strcasecmp (word[idx], "-quiet") == 0) + if (g_ascii_strcasecmp (word[idx], "-quiet") == 0) { idx++; quiet = TRUE; @@ -1069,7 +1069,7 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[]) if (wild) found = !match (var, vars[i].name); else - found = strcasecmp (var, vars[i].name); + found = g_ascii_strcasecmp (var, vars[i].name); if (found == 0) { @@ -1098,9 +1098,9 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[]) *((int *) &prefs + vars[i].offset) = 1; else *((int *) &prefs + vars[i].offset) = 0; - if (!strcasecmp (val, "YES") || !strcasecmp (val, "ON")) + if (!g_ascii_strcasecmp (val, "YES") || !g_ascii_strcasecmp (val, "ON")) *((int *) &prefs + vars[i].offset) = 1; - if (!strcasecmp (val, "NO") || !strcasecmp (val, "OFF")) + if (!g_ascii_strcasecmp (val, "NO") || !g_ascii_strcasecmp (val, "OFF")) *((int *) &prefs + vars[i].offset) = 0; } else { diff --git a/src/common/chanopt.c b/src/common/chanopt.c index f8e16e8b..198ebe6c 100644 --- a/src/common/chanopt.c +++ b/src/common/chanopt.c @@ -84,9 +84,9 @@ chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[]) if (word[offset][0]) { - if (!strcasecmp (word[offset], "ON")) + if (!g_ascii_strcasecmp (word[offset], "ON")) newval = 1; - else if (!strcasecmp (word[offset], "OFF")) + else if (!g_ascii_strcasecmp (word[offset], "OFF")) newval = 0; else if (word[offset][0] == 'u') newval = SET_DEFAULT; @@ -186,8 +186,8 @@ chanopt_find (char *network, char *channel, gboolean add_new) for (list = chanopt_list; list; list = list->next) { co = list->data; - if (!strcasecmp (co->channel, channel) && - !strcasecmp (co->network, network)) + if (!g_ascii_strcasecmp (co->channel, channel) && + !g_ascii_strcasecmp (co->network, network)) return co; } diff --git a/src/common/ctcp.c b/src/common/ctcp.c index 2bb75746..36952db7 100644 --- a/src/common/ctcp.c +++ b/src/common/ctcp.c @@ -73,7 +73,7 @@ ctcp_check (session *sess, char *nick, char *word[], char *word_eol[], while (list) { pop = (struct popup *) list->data; - if (!strcasecmp (ctcp, pop->name)) + if (!g_ascii_strcasecmp (ctcp, pop->name)) { ctcp_reply (sess, nick, word, word_eol, pop->cmd); ret = 1; @@ -97,7 +97,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip, ctcp_offset = 3; /* consider DCC to be different from other CTCPs */ - if (!strncasecmp (msg, "DCC", 3)) + if (!g_ascii_strncasecmp (msg, "DCC", 3)) { /* but still let CTCP replies override it */ if (!ctcp_check (sess, nick, word, word_eol, word[4] + ctcp_offset)) @@ -110,7 +110,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip, /* consider ACTION to be different from other CTCPs. Check ignore as if it was a PRIV/CHAN. */ - if (!strncasecmp (msg, "ACTION ", 7)) + if (!g_ascii_strncasecmp (msg, "ACTION ", 7)) { if (is_channel (serv, to)) { @@ -135,7 +135,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip, if (ignore_check (word[1], IG_CTCP)) return; - if (!strcasecmp (msg, "VERSION") && !prefs.hidever) + if (!g_ascii_strcasecmp (msg, "VERSION") && !prefs.hidever) { #ifdef WIN32 snprintf (outbuf, sizeof (outbuf), "VERSION XChat-WDK "PACKAGE_VERSION" [x%d] / %s", @@ -149,7 +149,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip, if (!ctcp_check (sess, nick, word, word_eol, word[4] + ctcp_offset)) { - if (!strncasecmp (msg, "SOUND", 5)) + if (!g_ascii_strncasecmp (msg, "SOUND", 5)) { po = strchr (word[5], '\001'); if (po) diff --git a/src/common/dcc.c b/src/common/dcc.c index d91b7e8e..4c8724d9 100644 --- a/src/common/dcc.c +++ b/src/common/dcc.c @@ -572,7 +572,7 @@ dcc_chat_line (struct DCC *dcc, char *line) url_check_line (line, len); - if (line[0] == 1 && !strncasecmp (line + 1, "ACTION", 6)) + if (line[0] == 1 && !g_ascii_strncasecmp (line + 1, "ACTION", 6)) { po = strchr (line + 8, '\001'); if (po) @@ -1940,9 +1940,9 @@ find_dcc (char *nick, char *file, int type) { if (!file[0]) return dcc; - if (!strcasecmp (file, file_part (dcc->file))) + if (!g_ascii_strcasecmp (file, file_part (dcc->file))) return dcc; - if (!strcasecmp (file, dcc->file)) + if (!g_ascii_strcasecmp (file, dcc->file)) return dcc; } } @@ -2406,7 +2406,7 @@ handle_dcc (struct session *sess, char *nick, char *word[], DCC_SIZE size; int psend = 0; - if (!strcasecmp (type, "CHAT")) + if (!g_ascii_strcasecmp (type, "CHAT")) { port = atoi (word[8]); addr = strtoul (word[7], NULL, 10); @@ -2453,7 +2453,7 @@ handle_dcc (struct session *sess, char *nick, char *word[], return; } - if (!strcasecmp (type, "Resume")) + if (!g_ascii_strcasecmp (type, "Resume")) { port = atoi (word[7]); @@ -2497,7 +2497,7 @@ handle_dcc (struct session *sess, char *nick, char *word[], } return; } - if (!strcasecmp (type, "Accept")) + if (!g_ascii_strcasecmp (type, "Accept")) { port = atoi (word[7]); dcc = find_dcc_from_port (port, TYPE_RECV); @@ -2507,7 +2507,7 @@ handle_dcc (struct session *sess, char *nick, char *word[], } return; } - if (!strcasecmp (type, "SEND")) + if (!g_ascii_strcasecmp (type, "SEND")) { char *file = file_part (word[6]); diff --git a/src/common/inbound.c b/src/common/inbound.c index 1c124db4..89899655 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -886,7 +886,7 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id) if (msg[0] == '[' && (!serv->have_idmsg || id)) { /* guess where chanserv meant to post this -sigh- */ - if (!strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick)) + if (!g_ascii_strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick)) { char *dest = strdup (msg + 1); char *end = strchr (dest, ']'); diff --git a/src/common/modes.c b/src/common/modes.c index 1acf7f54..6eb63f3b 100644 --- a/src/common/modes.c +++ b/src/common/modes.c @@ -789,20 +789,20 @@ inbound_005 (server * serv, char *word[]) } /* use /NICKSERV */ - if (strcasecmp (word[w] + 8, "RusNet") == 0) + if (g_ascii_strcasecmp (word[w] + 8, "RusNet") == 0) serv->nickservtype = 1; - else if (strcasecmp (word[w] + 8, "UniBG") == 0) + else if (g_ascii_strcasecmp (word[w] + 8, "UniBG") == 0) serv->nickservtype = 3; - else if (strcasecmp (word[w] + 8, "QuakeNet") == 0) + else if (g_ascii_strcasecmp (word[w] + 8, "QuakeNet") == 0) serv->nickservtype = 4; } else if (strncmp (word[w], "CASEMAPPING=", 12) == 0) { if (strcmp (word[w] + 12, "ascii") == 0) /* bahamut */ - serv->p_cmp = (void *)strcasecmp; + serv->p_cmp = (void *)g_ascii_strcasecmp; } else if (strncmp (word[w], "CHARSET=", 8) == 0) { - if (strcasecmp (word[w] + 8, "UTF-8") == 0) + if (g_ascii_strcasecmp (word[w] + 8, "UTF-8") == 0) { server_set_encoding (serv, "UTF-8"); } diff --git a/src/common/outbound.c b/src/common/outbound.c index b13a33a1..872ef50b 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -617,13 +617,13 @@ cmd_clear (struct session *sess, char *tbuf, char *word[], char *word_eol[]) GSList *list = sess_list; char *reason = word_eol[2]; - if (strcasecmp (reason, "HISTORY") == 0) + if (g_ascii_strcasecmp (reason, "HISTORY") == 0) { history_free (&sess->history); return TRUE; } - if (strncasecmp (reason, "all", 3) == 0) + if (g_ascii_strncasecmp (reason, "all", 3) == 0) { while (list) { @@ -750,26 +750,26 @@ cmd_dcc (struct session *sess, char *tbuf, char *word[], char *word_eol[]) char *type = word[2]; if (*type) { - if (!strcasecmp (type, "HELP")) + if (!g_ascii_strcasecmp (type, "HELP")) return FALSE; - if (!strcasecmp (type, "CLOSE")) + if (!g_ascii_strcasecmp (type, "CLOSE")) { if (*word[3] && *word[4]) { goodtype = 0; - if (!strcasecmp (word[3], "SEND")) + if (!g_ascii_strcasecmp (word[3], "SEND")) { dcc = find_dcc (word[4], word[5], TYPE_SEND); dcc_abort (sess, dcc); goodtype = TRUE; } - if (!strcasecmp (word[3], "GET")) + if (!g_ascii_strcasecmp (word[3], "GET")) { dcc = find_dcc (word[4], word[5], TYPE_RECV); dcc_abort (sess, dcc); goodtype = TRUE; } - if (!strcasecmp (word[3], "CHAT")) + if (!g_ascii_strcasecmp (word[3], "CHAT")) { dcc = find_dcc (word[4], "", TYPE_CHATRECV); if (!dcc) @@ -789,20 +789,20 @@ cmd_dcc (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } return FALSE; } - if ((!strcasecmp (type, "CHAT")) || (!strcasecmp (type, "PCHAT"))) + if ((!g_ascii_strcasecmp (type, "CHAT")) || (!g_ascii_strcasecmp (type, "PCHAT"))) { char *nick = word[3]; - int passive = (!strcasecmp(type, "PCHAT")) ? 1 : 0; + int passive = (!g_ascii_strcasecmp(type, "PCHAT")) ? 1 : 0; if (*nick) dcc_chat (sess, nick, passive); return TRUE; } - if (!strcasecmp (type, "LIST")) + if (!g_ascii_strcasecmp (type, "LIST")) { dcc_show_list (sess); return TRUE; } - if (!strcasecmp (type, "GET")) + if (!g_ascii_strcasecmp (type, "GET")) { char *nick = word[3]; char *file = word[4]; @@ -820,18 +820,18 @@ cmd_dcc (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } return TRUE; } - if ((!strcasecmp (type, "SEND")) || (!strcasecmp (type, "PSEND"))) + if ((!g_ascii_strcasecmp (type, "SEND")) || (!g_ascii_strcasecmp (type, "PSEND"))) { int i = 3, maxcps; char *nick, *file; - int passive = (!strcasecmp(type, "PSEND")) ? 1 : 0; + int passive = (!g_ascii_strcasecmp(type, "PSEND")) ? 1 : 0; nick = word[i]; if (!*nick) return FALSE; maxcps = prefs.dcc_max_send_cps; - if (!strncasecmp(nick, "-maxcps=", 8)) + if (!g_ascii_strncasecmp(nick, "-maxcps=", 8)) { maxcps = atoi(nick + 8); i++; @@ -1312,7 +1312,7 @@ cmd_menu (struct session *sess, char *tbuf, char *word[], char *word_eol[]) *p = '/'; } - if (!strcasecmp (word[idx], "ADD")) + if (!g_ascii_strcasecmp (word[idx], "ADD")) { if (toggle) { @@ -1327,7 +1327,7 @@ cmd_menu (struct session *sess, char *tbuf, char *word[], char *word_eol[]) return TRUE; } - if (!strcasecmp (word[idx], "DEL")) + if (!g_ascii_strcasecmp (word[idx], "DEL")) { menu_del (tbuf, label); return TRUE; @@ -2045,7 +2045,7 @@ cmd_gui (struct session *sess, char *tbuf, char *word[], char *word_eol[]) case 0xc0851aaa: fe_message (word[3], FE_MSG_INFO|FE_MSG_MARKUP); break; /* MSGBOX */ case 0x0035dafd: fe_ctrl_gui (sess, 1, 0); break; /* SHOW */ case 0x0033155f: /* MENU */ - if (!strcasecmp (word[3], "TOGGLE")) + if (!g_ascii_strcasecmp (word[3], "TOGGLE")) fe_ctrl_gui (sess, 6, 0); else return FALSE; @@ -2247,25 +2247,25 @@ cmd_ignore (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } return TRUE; } - if (!strcasecmp (word[i], "UNIGNORE")) + if (!g_ascii_strcasecmp (word[i], "UNIGNORE")) type |= IG_UNIG; - else if (!strcasecmp (word[i], "ALL")) + else if (!g_ascii_strcasecmp (word[i], "ALL")) type |= IG_PRIV | IG_NOTI | IG_CHAN | IG_CTCP | IG_INVI | IG_DCC; - else if (!strcasecmp (word[i], "PRIV")) + else if (!g_ascii_strcasecmp (word[i], "PRIV")) type |= IG_PRIV; - else if (!strcasecmp (word[i], "NOTI")) + else if (!g_ascii_strcasecmp (word[i], "NOTI")) type |= IG_NOTI; - else if (!strcasecmp (word[i], "CHAN")) + else if (!g_ascii_strcasecmp (word[i], "CHAN")) type |= IG_CHAN; - else if (!strcasecmp (word[i], "CTCP")) + else if (!g_ascii_strcasecmp (word[i], "CTCP")) type |= IG_CTCP; - else if (!strcasecmp (word[i], "INVI")) + else if (!g_ascii_strcasecmp (word[i], "INVI")) type |= IG_INVI; - else if (!strcasecmp (word[i], "QUIET")) + else if (!g_ascii_strcasecmp (word[i], "QUIET")) quiet = 1; - else if (!strcasecmp (word[i], "NOSAVE")) + else if (!g_ascii_strcasecmp (word[i], "NOSAVE")) type |= IG_NOSAVE; - else if (!strcasecmp (word[i], "DCC")) + else if (!g_ascii_strcasecmp (word[i], "DCC")) type |= IG_DCC; else { @@ -2456,12 +2456,12 @@ cmd_load (struct session *sess, char *tbuf, char *word[], char *word_eol[]) #ifdef USE_PLUGIN len = strlen (word[2]); #ifdef WIN32 - if (len > 4 && strcasecmp (".dll", word[2] + len - 4) == 0) + if (len > 4 && g_ascii_strcasecmp (".dll", word[2] + len - 4) == 0) #else #if defined(__hpux) - if (len > 3 && strcasecmp (".sl", word[2] + len - 3) == 0) + if (len > 3 && g_ascii_strcasecmp (".sl", word[2] + len - 3) == 0) #else - if (len > 3 && strcasecmp (".so", word[2] + len - 3) == 0) + if (len > 3 && g_ascii_strcasecmp (".so", word[2] + len - 3) == 0) #endif #endif { @@ -2613,8 +2613,8 @@ cmd_msg (struct session *sess, char *tbuf, char *word[], char *word_eol[]) else { /* mask out passwords */ - if (strcasecmp (nick, "nickserv") == 0 && - strncasecmp (msg, "identify ", 9) == 0) + if (g_ascii_strcasecmp (nick, "nickserv") == 0 && + g_ascii_strncasecmp (msg, "identify ", 9) == 0) msg = "identify ****"; EMIT_SIGNAL (XP_TE_MSGSEND, sess, nick, msg, NULL, NULL, 0); } @@ -2825,7 +2825,7 @@ cmd_reconnect (struct session *sess, char *tbuf, char *word[], char *word_eol[]) prefs.recon_delay = 0; - if (!strcasecmp (word[2], "ALL")) + if (!g_ascii_strcasecmp (word[2], "ALL")) { list = serv_list; while (list) @@ -2997,7 +2997,7 @@ parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], in { char *co; #ifdef USE_OPENSSL - if (strncasecmp ("ircs://", url, 7) == 0) + if (g_ascii_strncasecmp ("ircs://", url, 7) == 0) { *use_ssl = TRUE; *server_name = url + 7; @@ -3005,7 +3005,7 @@ parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], in } #endif - if (strncasecmp ("irc://", url, 6) == 0) + if (g_ascii_strncasecmp ("irc://", url, 6) == 0) { *server_name = url + 6; #ifdef USE_OPENSSL @@ -3076,7 +3076,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[]) sess->server->network = NULL; /* dont clear it for /servchan */ - if (strncasecmp (word_eol[1], "SERVCHAN ", 9)) + if (g_ascii_strncasecmp (word_eol[1], "SERVCHAN ", 9)) sess->willjoinchannel[0] = 0; if (channel) @@ -3206,7 +3206,7 @@ cmd_unignore (struct session *sess, char *tbuf, char *word[], { if (ignore_del (mask, NULL)) { - if (strcasecmp (arg, "QUIET")) + if (g_ascii_strcasecmp (arg, "QUIET")) EMIT_SIGNAL (XP_TE_IGNOREREMOVE, sess, mask, NULL, NULL, NULL, 0); } return TRUE; @@ -3222,12 +3222,12 @@ cmd_unload (struct session *sess, char *tbuf, char *word[], char *word_eol[]) len = strlen (word[2]); #ifdef WIN32 - if (len > 4 && strcasecmp (word[2] + len - 4, ".dll") == 0) + if (len > 4 && g_ascii_strcasecmp (word[2] + len - 4, ".dll") == 0) #else #if defined(__hpux) - if (len > 3 && strcasecmp (word[2] + len - 3, ".sl") == 0) + if (len > 3 && g_ascii_strcasecmp (word[2] + len - 3, ".sl") == 0) #else - if (len > 3 && strcasecmp (word[2] + len - 3, ".so") == 0) + if (len > 3 && g_ascii_strcasecmp (word[2] + len - 3, ".so") == 0) #endif #endif by_file = TRUE; @@ -3257,7 +3257,7 @@ find_server_from_hostname (char *hostname) while (list) { serv = list->data; - if (!strcasecmp (hostname, serv->hostname) && serv->connected) + if (!g_ascii_strcasecmp (hostname, serv->hostname) && serv->connected) return serv; list = list->next; } @@ -3310,7 +3310,7 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[]) /* maybe we're already connected to this net */ /* check for "FreeNode" */ - net = servlist_net_find (server_name, NULL, strcasecmp); + net = servlist_net_find (server_name, NULL, g_ascii_strcasecmp); /* check for "irc.eu.freenode.net" */ if (!net) net = servlist_net_find_from_server (server_name); @@ -3705,7 +3705,7 @@ const struct commands xc_cmds[] = { static int command_compare (const void *a, const void *b) { - return strcasecmp (a, ((struct commands *)b)->name); + return g_ascii_strcasecmp (a, ((struct commands *)b)->name); } static struct commands * @@ -4277,7 +4277,7 @@ handle_command (session *sess, char *cmd, int check_spch) while (list) { pop = (struct popup *) list->data; - if (!strcasecmp (pop->name, word[1])) + if (!g_ascii_strcasecmp (pop->name, word[1])) { user_command (sess, tbuf, pop->cmd, word, word_eol); user_cmd = TRUE; diff --git a/src/common/plugin-timer.c b/src/common/plugin-timer.c index f09074a8..431ce8ab 100644 --- a/src/common/plugin-timer.c +++ b/src/common/plugin-timer.c @@ -4,7 +4,7 @@ #include "xchat-plugin.h" #ifdef WIN32 -#define strcasecmp stricmp +#define g_ascii_strcasecmp stricmp #endif static xchat_plugin *ph; /* plugin handle */ @@ -151,25 +151,25 @@ timer_cb (char *word[], char *word_eol[], void *userdata) return XCHAT_EAT_XCHAT; } - if (strcasecmp (word[2], "-quiet") == 0) + if (g_ascii_strcasecmp (word[2], "-quiet") == 0) { quiet = TRUE; offset++; } - if (strcasecmp (word[2 + offset], "-delete") == 0) + if (g_ascii_strcasecmp (word[2 + offset], "-delete") == 0) { timer_del_ref (atoi (word[3 + offset]), quiet); return XCHAT_EAT_XCHAT; } - if (strcasecmp (word[2 + offset], "-refnum") == 0) + if (g_ascii_strcasecmp (word[2 + offset], "-refnum") == 0) { ref = atoi (word[3 + offset]); offset += 2; } - if (strcasecmp (word[2 + offset], "-repeat") == 0) + if (g_ascii_strcasecmp (word[2 + offset], "-repeat") == 0) { repeat = atoi (word[3 + offset]); offset += 2; diff --git a/src/common/plugin.c b/src/common/plugin.c index 2e81c1f1..0a265d16 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -309,9 +309,9 @@ plugin_kill (char *name, int by_filename) { pl = list->data; /* static-plugins (plugin-timer.c) have a NULL filename */ - if ((by_filename && pl->filename && strcasecmp (name, pl->filename) == 0) || - (by_filename && pl->filename && strcasecmp (name, file_part (pl->filename)) == 0) || - (!by_filename && strcasecmp (name, pl->name) == 0)) + if ((by_filename && pl->filename && g_ascii_strcasecmp (name, pl->filename) == 0) || + (by_filename && pl->filename && g_ascii_strcasecmp (name, file_part (pl->filename)) == 0) || + (!by_filename && g_ascii_strcasecmp (name, pl->name) == 0)) { /* statically linked plugins have a NULL filename */ if (pl->filename != NULL && !pl->fake) @@ -472,12 +472,12 @@ plugin_hook_find (GSList *list, int type, char *name) hook = list->data; if (hook->type == type) { - if (strcasecmp (hook->name, name) == 0) + if (g_ascii_strcasecmp (hook->name, name) == 0) return list; if (type == HOOK_SERVER) { - if (strcasecmp (hook->name, "RAW LINE") == 0) + if (g_ascii_strcasecmp (hook->name, "RAW LINE") == 0) return list; } } @@ -947,8 +947,8 @@ xchat_find_context (xchat_plugin *ph, const char *servname, const char *channel) if (servname == NULL || rfc_casecmp (servname, serv->servername) == 0 || - strcasecmp (servname, serv->hostname) == 0 || - strcasecmp (servname, netname) == 0) + g_ascii_strcasecmp (servname, serv->hostname) == 0 || + g_ascii_strcasecmp (servname, netname) == 0) { if (channel == NULL) return serv->front_session; @@ -1121,7 +1121,7 @@ xchat_get_prefs (xchat_plugin *ph, const char *name, const char **string, int *i do { - if (!strcasecmp (name, vars[i].name)) + if (!g_ascii_strcasecmp (name, vars[i].name)) { switch (vars[i].type) { diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index a5ebc366..d8a6be7c 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -475,12 +475,12 @@ process_numeric (session * sess, int n, } /* use /NICKSERV */ - if (strcasecmp (word[7], "DALnet") == 0 || - strcasecmp (word[7], "BRASnet") == 0) + if (g_ascii_strcasecmp (word[7], "DALnet") == 0 || + g_ascii_strcasecmp (word[7], "BRASnet") == 0) serv->nickservtype = 1; /* use /NS */ - else if (strcasecmp (word[7], "FreeNode") == 0) + else if (g_ascii_strcasecmp (word[7], "FreeNode") == 0) serv->nickservtype = 2; goto def; @@ -1075,9 +1075,9 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[]) { text[len - 1] = 0; text++; - if (strncasecmp (text, "ACTION", 6) != 0) + if (g_ascii_strncasecmp (text, "ACTION", 6) != 0) flood_check (nick, ip, serv, sess, 0); - if (strncasecmp (text, "DCC ", 4) == 0) + if (g_ascii_strncasecmp (text, "DCC ", 4) == 0) /* redo this with handle_quotes TRUE */ process_data_init (word[1], word_eol[1], word, word_eol, TRUE, FALSE); ctcp_handle (sess, to, nick, ip, text, word, word_eol, id); diff --git a/src/common/server.c b/src/common/server.c index 919d9119..c8cc59e0 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -238,17 +238,17 @@ tcp_send_len (server *serv, char *buf, int len) dbuf[len + 1] = 0; /* privmsg and notice get a lower priority */ - if (strncasecmp (dbuf + 1, "PRIVMSG", 7) == 0 || - strncasecmp (dbuf + 1, "NOTICE", 6) == 0) + if (g_ascii_strncasecmp (dbuf + 1, "PRIVMSG", 7) == 0 || + g_ascii_strncasecmp (dbuf + 1, "NOTICE", 6) == 0) { dbuf[0] = 1; } else { /* WHO/MODE get the lowest priority */ - if (strncasecmp (dbuf + 1, "WHO ", 4) == 0 || + if (g_ascii_strncasecmp (dbuf + 1, "WHO ", 4) == 0 || /* but only MODE queries, not changes */ - (strncasecmp (dbuf + 1, "MODE", 4) == 0 && + (g_ascii_strncasecmp (dbuf + 1, "MODE", 4) == 0 && strchr (dbuf, '-') == NULL && strchr (dbuf, '+') == NULL)) dbuf[0] = 0; @@ -319,8 +319,8 @@ server_inline (server *serv, char *line, int len) if (serv->using_irc || /* 1. using CP1252/UTF-8 Hybrid */ (serv->encoding == NULL && prefs.utf8_locale) || /* OR 2. using system default->UTF-8 */ (serv->encoding != NULL && /* OR 3. explicitly set to UTF-8 */ - (strcasecmp (serv->encoding, "UTF8") == 0 || - strcasecmp (serv->encoding, "UTF-8") == 0))) + (g_ascii_strcasecmp (serv->encoding, "UTF8") == 0 || + g_ascii_strcasecmp (serv->encoding, "UTF-8") == 0))) { /* The user has the UTF-8 charset set, either via /charset command or from his UTF-8 locale. Thus, we first try the @@ -1824,10 +1824,10 @@ server_set_encoding (server *serv, char *new_encoding) space[0] = 0; /* server_inline() uses these flags */ - if (!strcasecmp (serv->encoding, "CP1255") || - !strcasecmp (serv->encoding, "WINDOWS-1255")) + if (!g_ascii_strcasecmp (serv->encoding, "CP1255") || + !g_ascii_strcasecmp (serv->encoding, "WINDOWS-1255")) serv->using_cp1255 = TRUE; - else if (!strcasecmp (serv->encoding, "IRC")) + else if (!g_ascii_strcasecmp (serv->encoding, "IRC")) serv->using_irc = TRUE; } } diff --git a/src/common/servlist.c b/src/common/servlist.c index c9d4b6a8..aa32aa4d 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -588,7 +588,7 @@ servlist_connect_by_netname (session *sess, char *network, gboolean join) { net = list->data; - if (strcasecmp (net->name, network) == 0) + if (g_ascii_strcasecmp (net->name, network) == 0) { servlist_connect (sess, net, join); return 1; @@ -733,7 +733,7 @@ servlist_net_find_from_server (char *server_name) while (slist) { serv = slist->data; - if (strcasecmp (serv->hostname, server_name) == 0) + if (g_ascii_strcasecmp (serv->hostname, server_name) == 0) return net; slist = slist->next; } @@ -1018,7 +1018,7 @@ servlist_check_encoding (char *charset) if (c) c[0] = 0; - if (!strcasecmp (charset, "IRC")) /* special case */ + if (!g_ascii_strcasecmp (charset, "IRC")) /* special case */ { if (c) c[0] = ' '; @@ -1093,8 +1093,8 @@ servlist_save (void) fprintf (fp, "J=%s\n", net->autojoin); if (net->nickserv) fprintf (fp, "B=%s\n", net->nickserv); - if (net->encoding && strcasecmp (net->encoding, "System") && - strcasecmp (net->encoding, "System default")) + if (net->encoding && g_ascii_strcasecmp (net->encoding, "System") && + g_ascii_strcasecmp (net->encoding, "System default")) { fprintf (fp, "E=%s\n", net->encoding); if (!servlist_check_encoding (net->encoding)) diff --git a/src/common/url.c b/src/common/url.c index b83732d1..9fa2d75c 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -82,7 +82,7 @@ url_find (char *urltext) { int pos; - if (tree_find (url_tree, urltext, (tree_cmp_func *)strcasecmp, NULL, &pos)) + if (tree_find (url_tree, urltext, (tree_cmp_func *)g_ascii_strcasecmp, NULL, &pos)) return 1; return 0; } @@ -117,7 +117,7 @@ url_add (char *urltext, int len) } if (!url_tree) - url_tree = tree_new ((tree_cmp_func *)strcasecmp, NULL); + url_tree = tree_new ((tree_cmp_func *)g_ascii_strcasecmp, NULL); size = tree_size (url_tree); /* 0 is unlimited */ @@ -186,7 +186,7 @@ url_check_word (char *word, int len) { int j; - /* This is pretty much strncasecmp(). */ + /* This is pretty much g_ascii_strncasecmp(). */ for (j = 0; j < l; j++) { unsigned char c = word[j]; @@ -238,7 +238,7 @@ url_check_word (char *word, int len) const unsigned char *p = &word[len - l]; int j; - /* This is pretty much strncasecmp(). */ + /* This is pretty much g_ascii_strncasecmp(). */ for (j = 0; j < l; j++) { if (tolower(p[j]) != suffix[i].s[j]) diff --git a/src/common/util.c b/src/common/util.c index 73e1b29a..fb4cd23e 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -283,7 +283,7 @@ nocasestrstr (const char *s, const char *wanted) if (len == 0) return (char *)s; - while (rfc_tolower(*s) != rfc_tolower(*wanted) || strncasecmp (s, wanted, len)) + while (rfc_tolower(*s) != rfc_tolower(*wanted) || g_ascii_strncasecmp (s, wanted, len)) if (*s++ == '\0') return (char *)NULL; return (char *)s; @@ -945,7 +945,7 @@ typedef struct static int country_compare (const void *a, const void *b) { - return strcasecmp (a, ((domain_t *)b)->code); + return g_ascii_strcasecmp (a, ((domain_t *)b)->code); } static const domain_t domain[] = diff --git a/src/common/xchat.h b/src/common/xchat.h index 540a7e1a..85c20186 100644 --- a/src/common/xchat.h +++ b/src/common/xchat.h @@ -41,8 +41,8 @@ void *xchat_realloc (char *old, int len, char *file, int line); #ifdef __EMX__ /* for o/s 2 */ #define OFLAGS O_BINARY -#define strcasecmp stricmp -#define strncasecmp strnicmp +#define g_ascii_strcasecmp stricmp +#define g_ascii_strncasecmp strnicmp #define PATH_MAX MAXPATHLEN #define FILEPATH_LEN_MAX MAXPATHLEN #endif diff --git a/src/fe-gtk/fkeys.c b/src/fe-gtk/fkeys.c index b9690731..4fbbebf6 100644 --- a/src/fe-gtk/fkeys.c +++ b/src/fe-gtk/fkeys.c @@ -1260,11 +1260,11 @@ key_action_scroll_page (GtkWidget * wid, GdkEventKey * evt, char *d1, if (d1) { - if (!strcasecmp (d1, "up")) + if (!g_ascii_strcasecmp (d1, "up")) type = PAGE_UP; - else if (!strcasecmp (d1, "+1")) + else if (!g_ascii_strcasecmp (d1, "+1")) type = LINE_DOWN; - else if (!strcasecmp (d1, "-1")) + else if (!g_ascii_strcasecmp (d1, "-1")) type = LINE_UP; } diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 0b7f7c43..1ff59354 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -1688,7 +1688,7 @@ mg_dnd_drop_file (session *sess, char *target, char *uri) while (*p) { next = strchr (p, '\r'); - if (strncasecmp ("file:", p, 5) == 0) + if (g_ascii_strncasecmp ("file:", p, 5) == 0) { if (next) *next = 0; @@ -2911,7 +2911,7 @@ mg_tabs_compare (session *a, session *b) if (a->type != SESS_CHANNEL && b->type == SESS_CHANNEL) return 1; - return strcasecmp (a->channel, b->channel); + return g_ascii_strcasecmp (a->channel, b->channel); } static void diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index 4760ba93..2a683604 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -484,18 +484,18 @@ menu_create (GtkWidget *menu, GSList *list, char *target, int check_path) { pop = (struct popup *) list->data; - if (!strncasecmp (pop->name, "SUB", 3)) + if (!g_ascii_strncasecmp (pop->name, "SUB", 3)) { childcount = 0; tempmenu = menu_quick_sub (pop->cmd, tempmenu, &subitem, XCMENU_DOLIST|XCMENU_MNEMONIC, -1); - } else if (!strncasecmp (pop->name, "TOGGLE", 6)) + } else if (!g_ascii_strncasecmp (pop->name, "TOGGLE", 6)) { childcount++; menu_toggle_item (pop->name + 7, tempmenu, toggle_cb, pop->cmd, cfg_get_bool (pop->cmd)); - } else if (!strncasecmp (pop->name, "ENDSUB", 6)) + } else if (!g_ascii_strncasecmp (pop->name, "ENDSUB", 6)) { /* empty sub menu due to no programs in PATH? */ if (check_path && childcount < 1) @@ -506,7 +506,7 @@ menu_create (GtkWidget *menu, GSList *list, char *target, int check_path) tempmenu = menu_quick_endsub (); /* If we get here and tempmenu equals menu that means we havent got any submenus to exit from */ - } else if (!strncasecmp (pop->name, "SEP", 3)) + } else if (!g_ascii_strncasecmp (pop->name, "SEP", 3)) { menu_quick_item (0, 0, tempmenu, XCMENU_SHADED, 0, 0); @@ -2190,7 +2190,7 @@ menu_create_main (void *accel_group, int bar, int away, int toplevel, g_object_get (settings, "gtk-key-theme-name", &key_theme, NULL); if (key_theme) { - if (!strcasecmp (key_theme, "Emacs")) + if (!g_ascii_strcasecmp (key_theme, "Emacs")) { close_mask = GDK_SHIFT_MASK | GDK_CONTROL_MASK; mymenu[SEARCH_OFFSET].key = 0; diff --git a/src/fe-gtk/notifygui.c b/src/fe-gtk/notifygui.c index 5acb683a..135a548d 100644 --- a/src/fe-gtk/notifygui.c +++ b/src/fe-gtk/notifygui.c @@ -321,7 +321,7 @@ notifygui_add_cb (GtkDialog *dialog, gint response, gpointer entry) if (text[0] && response == GTK_RESPONSE_ACCEPT) { networks = GTK_ENTRY (g_object_get_data (G_OBJECT (entry), "net"))->text; - if (strcasecmp (networks, "ALL") == 0 || networks[0] == 0) + if (g_ascii_strcasecmp (networks, "ALL") == 0 || networks[0] == 0) notify_adduser (text, NULL); else notify_adduser (text, networks); diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c index 71d2f02e..7d2dc85d 100644 --- a/src/fe-gtk/plugingui.c +++ b/src/fe-gtk/plugingui.c @@ -176,12 +176,12 @@ plugingui_unload (GtkWidget * wid, gpointer unused) len = strlen (file); #ifdef WIN32 - if (len > 4 && strcasecmp (file + len - 4, ".dll") == 0) + if (len > 4 && g_ascii_strcasecmp (file + len - 4, ".dll") == 0) #else #if defined(__hpux) - if (len > 3 && strcasecmp (file + len - 3, ".sl") == 0) + if (len > 3 && g_ascii_strcasecmp (file + len - 3, ".sl") == 0) #else - if (len > 3 && strcasecmp (file + len - 3, ".so") == 0) + if (len > 3 && g_ascii_strcasecmp (file + len - 3, ".so") == 0) #endif #endif { diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c index 9483f04b..d6f4ad63 100644 --- a/src/fe-gtk/sexy-spell-entry.c +++ b/src/fe-gtk/sexy-spell-entry.c @@ -976,7 +976,7 @@ sexy_spell_entry_activate_default_languages(SexySpellEntry *entry) enchant_langs = sexy_spell_entry_get_languages(entry); /*for (i = 0; langs[i]; i++) { - if ((g_strncasecmp(langs[i], "C", 1) != 0) && + if ((g_ascii_strncasecmp(langs[i], "C", 1) != 0) && (strlen(langs[i]) >= 2) && enchant_has_lang(langs[i], enchant_langs)) { if ((lastprefix == NULL) || (g_str_has_prefix(langs[i], lastprefix) == FALSE)) @@ -1013,7 +1013,7 @@ sexy_spell_entry_activate_default_languages(SexySpellEntry *entry) lang = (gchar *) g_getenv("LANG"); if (lang != NULL) { - if (g_strncasecmp(lang, "C", 1) == 0) + if (g_ascii_strncasecmp(lang, "C", 1) == 0) lang = NULL; else if (lang[0] == '\0') lang = NULL; diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 6e314f68..547affee 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -198,7 +198,7 @@ nocasestrstr (const char *s, const char *tofind) if (len == 0) return (char *)s; - while (toupper(*s) != toupper(*tofind) || strncasecmp (s, tofind, len)) + while (toupper(*s) != toupper(*tofind) || g_ascii_strncasecmp (s, tofind, len)) if (*s++ == '\0') return (char *)NULL; return (char *)s;