diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-03-09 12:17:55 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-03-09 12:17:55 +0000 |
commit | 72930e0be3a8841e8149b246542832128310c350 (patch) | |
tree | c4cb68d6557440d1144126dac6f8bacbfb72a191 /src/irc/dcc | |
parent | 7df46597e17ff7af4a660ab47673fe2cabc91db6 (diff) | |
download | irssi-72930e0be3a8841e8149b246542832128310c350.zip |
Use g_ascii_str{,n}casecmp for case insensitive comparison with
ascii only strings.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4739 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/dcc')
-rw-r--r-- | src/irc/dcc/dcc-chat.c | 10 | ||||
-rw-r--r-- | src/irc/dcc/dcc-server.c | 8 | ||||
-rw-r--r-- | src/irc/dcc/dcc.c | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/irc/dcc/dcc-chat.c b/src/irc/dcc/dcc-chat.c index 5569cd96..782c33b3 100644 --- a/src/irc/dcc/dcc-chat.c +++ b/src/irc/dcc/dcc-chat.c @@ -539,7 +539,7 @@ static void cmd_mircdcc(const char *data, SERVER_REC *server, if (dcc == NULL) return; dcc->mirc_ctcp = i_toupper(*data) != 'N' && - g_strncasecmp(data, "OF", 2) != 0; + g_ascii_strncasecmp(data, "OF", 2) != 0; } /* DCC CLOSE CHAT <nick> - check only from chat_ids in open DCC chats, @@ -553,7 +553,7 @@ static void cmd_dcc_close(char *data, SERVER_REC *server) g_return_if_fail(data != NULL); - if (g_strncasecmp(data, "CHAT ", 5) != 0 || + if (g_ascii_strncasecmp(data, "CHAT ", 5) != 0 || !cmd_get_params(data, &free_arg, 2, NULL, &nick)) return; @@ -694,11 +694,11 @@ static void dcc_chat_msg(CHAT_DCC_REC *dcc, const char *msg) g_return_if_fail(msg != NULL); reply = FALSE; - if (g_strncasecmp(msg, "CTCP_MESSAGE ", 13) == 0) { + if (g_ascii_strncasecmp(msg, "CTCP_MESSAGE ", 13) == 0) { /* bitchx (and ircii?) sends this */ msg += 13; dcc->mirc_ctcp = FALSE; - } else if (g_strncasecmp(msg, "CTCP_REPLY ", 11) == 0) { + } else if (g_ascii_strncasecmp(msg, "CTCP_REPLY ", 11) == 0) { /* bitchx (and ircii?) sends this */ msg += 11; reply = TRUE; @@ -761,7 +761,7 @@ static void ctcp_reply_dcc_reject(IRC_SERVER_REC *server, const char *data, /* default REJECT handler checks args too - we don't care about it in DCC chats. */ - if (g_strncasecmp(data, "CHAT", 4) == 0 && + if (g_ascii_strncasecmp(data, "CHAT", 4) == 0 && (data[4] == '\0' || data[4] == ' ')) { dcc = dcc_find_request(DCC_CHAT_TYPE, nick, NULL); if (dcc != NULL) dcc_close(dcc); diff --git a/src/irc/dcc/dcc-server.c b/src/irc/dcc/dcc-server.c index 147e83fa..73a56d62 100644 --- a/src/irc/dcc/dcc-server.c +++ b/src/irc/dcc/dcc-server.c @@ -199,7 +199,7 @@ static void dcc_server_msg(SERVER_DCC_REC *dcc, const char *msg) g_return_if_fail(msg != NULL); /* Check for CHAT protocol */ - if (g_strncasecmp(msg, "100 ", 4) == 0) { + if (g_ascii_strncasecmp(msg, "100 ", 4) == 0) { msg += 4; /* Check if this server is accepting chat requests.*/ if (dcc->accept_chat) { @@ -227,7 +227,7 @@ static void dcc_server_msg(SERVER_DCC_REC *dcc, const char *msg) } /* Check for FSERVE protocol */ - if (g_strncasecmp(msg, "110 ", 4) == 0) { + if (g_ascii_strncasecmp(msg, "110 ", 4) == 0) { msg += 4; /* Check if this server is accepting fserve requests.*/ if (dcc->accept_fserve) { @@ -236,7 +236,7 @@ static void dcc_server_msg(SERVER_DCC_REC *dcc, const char *msg) } /* Check for SEND protocol */ - if (g_strncasecmp(msg, "120 ", 4) == 0) { + if (g_ascii_strncasecmp(msg, "120 ", 4) == 0) { msg += 4; /* Check if this server is accepting send requests.*/ if (dcc->accept_send) { @@ -368,7 +368,7 @@ static void cmd_dcc_close(char *data, SERVER_REC *server) g_return_if_fail(data != NULL); - if (g_strncasecmp(data, "SERVER ", 7) != 0 || + if (g_ascii_strncasecmp(data, "SERVER ", 7) != 0 || !cmd_get_params(data, &free_arg, 2, NULL, &port_str)) { return; } diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c index 3078a093..bc8d8452 100644 --- a/src/irc/dcc/dcc.c +++ b/src/irc/dcc/dcc.c @@ -332,7 +332,7 @@ static void sig_server_nick_changed(IRC_SERVER_REC *server) static void ctcp_msg(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target) { - if (g_strncasecmp(data, "dcc ", 4) != 0) + if (g_ascii_strncasecmp(data, "dcc ", 4) != 0) return; data += 4; @@ -345,7 +345,7 @@ static void ctcp_msg(IRC_SERVER_REC *server, const char *data, static void ctcp_reply(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target) { - if (g_strncasecmp(data, "dcc ", 4) != 0) + if (g_ascii_strncasecmp(data, "dcc ", 4) != 0) return; data += 4; |