diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-09-03 12:37:20 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-09-03 12:37:20 +0000 |
commit | d80c8e9e575239553719b4991b40e2dca6e6478e (patch) | |
tree | 6ab848f808bd4301452089eda9784801b706b0b6 /src/irc | |
parent | f74b280a1fe2566d1182d1e2180d12a514b3d6c9 (diff) | |
download | weechat-d80c8e9e575239553719b4991b40e2dca6e6478e.zip |
Fixed bug with strings comparison (str[n]casecmp) and some locales (like turkish), now using ASCII comparison
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/irc-channel.c | 2 | ||||
-rw-r--r-- | src/irc/irc-nick.c | 13 | ||||
-rw-r--r-- | src/irc/irc-recv.c | 12 | ||||
-rw-r--r-- | src/irc/irc-send.c | 4 |
4 files changed, 15 insertions, 16 deletions
diff --git a/src/irc/irc-channel.c b/src/irc/irc-channel.c index 0323b7869..6aec9902f 100644 --- a/src/irc/irc-channel.c +++ b/src/irc/irc-channel.c @@ -147,7 +147,7 @@ channel_search (t_irc_server *server, char *channel_name) for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { - if (strcasecmp (ptr_channel->name, channel_name) == 0) + if (ascii_strcasecmp (ptr_channel->name, channel_name) == 0) return ptr_channel; } return NULL; diff --git a/src/irc/irc-nick.c b/src/irc/irc-nick.c index af845e3f2..37d4aaf6c 100644 --- a/src/irc/irc-nick.c +++ b/src/irc/irc-nick.c @@ -33,7 +33,7 @@ /* - * nick_find_color: find a color for a nick (less used will be better!) + * nick_find_color: find a color for a nick (according to nick letters) */ int @@ -87,12 +87,11 @@ nick_compare (t_irc_nick *nick1, t_irc_nick *nick2) score1 = nick_score_for_sort (nick1); score2 = nick_score_for_sort (nick2); - comp = strcasecmp(nick1->nick, nick2->nick); + comp = ascii_strcasecmp (nick1->nick, nick2->nick); if (comp > 0) score1++; - else - if (comp < 0) - score2++; + if (comp < 0) + score2++; /* nick1 > nick2 */ if (score1 > score2) @@ -202,7 +201,7 @@ nick_new (t_irc_channel *channel, char *nick_name, new_nick->is_halfop = is_halfop; new_nick->has_voice = has_voice; new_nick->is_away = 0; - if (strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0) + if (ascii_strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0) new_nick->color = COLOR_WIN_NICK_SELF; else new_nick->color = nick_find_color (new_nick); @@ -319,7 +318,7 @@ nick_search (t_irc_channel *channel, char *nickname) for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick) { - if (strcasecmp (ptr_nick->nick, nickname) == 0) + if (ascii_strcasecmp (ptr_nick->nick, nickname) == 0) return ptr_nick; } return NULL; diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c index 781e0db9a..eecefc12d 100644 --- a/src/irc/irc-recv.c +++ b/src/irc/irc-recv.c @@ -150,7 +150,7 @@ irc_recv_command (t_irc_server *server, char *entire_line, cmd_found = -1; for (i = 0; irc_commands[i].command_name; i++) { - if (strcasecmp (irc_commands[i].command_name, command) == 0) + if (ascii_strcasecmp (irc_commands[i].command_name, command) == 0) { cmd_found = i; break; @@ -929,7 +929,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments) if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer)) { if ((CHANNEL(ptr_buffer)->name) - && (strcasecmp (host, CHANNEL(ptr_buffer)->name) == 0)) + && (ascii_strcasecmp (host, CHANNEL(ptr_buffer)->name) == 0)) { free (CHANNEL(ptr_buffer)->name); CHANNEL(ptr_buffer)->name = strdup (arguments); @@ -1104,9 +1104,9 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *arguments) gui_printf_color (server->buffer, COLOR_WIN_CHAT, ": "); } gui_printf_color (server->buffer, COLOR_WIN_CHAT, "%s\n", pos); - if ((host) && (strcasecmp (host, "nickserv") != 0) && - (strcasecmp (host, "chanserv") != 0) && - (strcasecmp (host, "memoserv") != 0)) + if ((host) && (ascii_strcasecmp (host, "nickserv") != 0) && + (ascii_strcasecmp (host, "chanserv") != 0) && + (ascii_strcasecmp (host, "memoserv") != 0)) { hotlist_add (HOTLIST_PRIVATE, server->buffer); gui_draw_buffer_status (gui_current_window->buffer, 1); @@ -1789,7 +1789,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *arguments) while (pos_port[0] == ' ') pos_port++; - if (strcasecmp (pos_file, "chat") != 0) + if (ascii_strcasecmp (pos_file, "chat") != 0) { irc_display_prefix (server->buffer, PREFIX_ERROR); gui_printf_nolog (server->buffer, diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c index fa1a1bb92..854e73311 100644 --- a/src/irc/irc-send.c +++ b/src/irc/irc-send.c @@ -367,7 +367,7 @@ irc_cmd_send_ctcp (t_irc_server *server, char *arguments) gui_printf_color (server->buffer, COLOR_WIN_CHAT, ": "); gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%s", pos_type); - if ((strcasecmp (pos_type, "ping") == 0) && (!pos_args)) + if ((ascii_strcasecmp (pos_type, "ping") == 0) && (!pos_args)) { gettimeofday (&tv, &tz); server_sendf (server, "PRIVMSG %s :\01PING %d %d\01\r\n", @@ -451,7 +451,7 @@ irc_cmd_send_dcc (t_irc_server *server, char *arguments) dcc_send_request (server, DCC_CHAT_SEND, pos_nick, NULL); } - else if (strcasecmp (arguments, "close") == 0) + else if (ascii_strcasecmp (arguments, "close") == 0) { if (BUFFER_IS_PRIVATE(gui_current_window->buffer) && CHANNEL(gui_current_window->buffer)->dcc_chat) |