mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 21:36:37 +02:00
Fixed bug with strings comparison (str[n]casecmp) and some locales (like turkish), now using ASCII comparison
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-09-02
|
||||
ChangeLog - 2005-09-03
|
||||
|
||||
|
||||
Version 0.1.5 (under dev!):
|
||||
* fixed bug with strings comparison (str[n]casecmp) and some locales
|
||||
(like turkish), now using ASCII comparison (thanks to roktas)
|
||||
* signal SIGQUIT is now ignored
|
||||
* fixed refresh bug when one line is bigger than screen size
|
||||
* fixed look_nicklist_min_size and look_nicklist_max_size options
|
||||
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.1.5-cvs\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2005-08-21 14:31+0200\n"
|
||||
"PO-Revision-Date: 2005-08-21 14:31+0200\n"
|
||||
"PO-Revision-Date: 2005-09-03 13:24+0200\n"
|
||||
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -2673,7 +2673,7 @@ msgstr "%s l'alias ou la commande \"%s\" existe d
|
||||
#: src/common/command.c:282
|
||||
#, c-format
|
||||
msgid "%s alias cannot run another alias!\n"
|
||||
msgstr "%s l'alias ne peux pas lancer un autre alias !\n"
|
||||
msgstr "%s l'alias ne peut pas lancer un autre alias !\n"
|
||||
|
||||
#: src/common/command.c:289
|
||||
#, c-format
|
||||
|
||||
+51
-51
@@ -191,7 +191,7 @@ alias_search (char *alias_name)
|
||||
|
||||
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
if (strcasecmp (alias_name, ptr_alias->alias_name) == 0)
|
||||
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) == 0)
|
||||
return ptr_alias;
|
||||
}
|
||||
return NULL;
|
||||
@@ -208,7 +208,7 @@ alias_find_pos (char *alias_name)
|
||||
|
||||
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
if (strcasecmp (alias_name, ptr_alias->alias_name) < 0)
|
||||
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) < 0)
|
||||
return ptr_alias;
|
||||
}
|
||||
return NULL;
|
||||
@@ -484,7 +484,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
{
|
||||
if (strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
|
||||
if (ascii_strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
|
||||
{
|
||||
if ((argc < weechat_commands[i].min_arg)
|
||||
|| (argc > weechat_commands[i].max_arg))
|
||||
@@ -544,7 +544,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
}
|
||||
for (i = 0; irc_commands[i].command_name; i++)
|
||||
{
|
||||
if ((strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
|
||||
if ((ascii_strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
|
||||
((irc_commands[i].cmd_function_args) ||
|
||||
(irc_commands[i].cmd_function_1arg)))
|
||||
{
|
||||
@@ -615,7 +615,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
for (ptr_alias = weechat_alias; ptr_alias;
|
||||
ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
if (strcasecmp (ptr_alias->alias_name, command + 1) == 0)
|
||||
if (ascii_strcasecmp (ptr_alias->alias_name, command + 1) == 0)
|
||||
{
|
||||
if (ptr_args)
|
||||
{
|
||||
@@ -890,7 +890,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
char *error;
|
||||
int target_buffer;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened buffers */
|
||||
|
||||
@@ -908,7 +908,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "move") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "move") == 0)
|
||||
{
|
||||
/* move buffer to another number in the list */
|
||||
|
||||
@@ -943,7 +943,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (argv[0], "close") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "close") == 0)
|
||||
{
|
||||
/* close buffer (server or channel/private) */
|
||||
|
||||
@@ -995,7 +995,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
}
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "notify") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "notify") == 0)
|
||||
{
|
||||
/* set notify level for buffer */
|
||||
|
||||
@@ -1114,7 +1114,7 @@ weechat_cmd_clear (int argc, char **argv)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
if (strcasecmp (argv[0], "-all") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "-all") == 0)
|
||||
gui_buffer_clear_all ();
|
||||
else
|
||||
{
|
||||
@@ -1198,7 +1198,7 @@ weechat_cmd_debug (int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strcasecmp (argv[0], "dump") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "dump") == 0)
|
||||
{
|
||||
wee_dump (0);
|
||||
}
|
||||
@@ -1294,7 +1294,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
{
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
{
|
||||
if (strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
|
||||
if (ascii_strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, "[w]");
|
||||
@@ -1319,7 +1319,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
}
|
||||
for (i = 0; irc_commands[i].command_name; i++)
|
||||
{
|
||||
if ((strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
|
||||
if ((ascii_strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
|
||||
&& (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg))
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
@@ -1402,7 +1402,7 @@ weechat_cmd_key (char *arguments)
|
||||
weechat_cmd_key_display (ptr_key, 0);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "unbind ", 7) == 0)
|
||||
else if (ascii_strncasecmp (arguments, "unbind ", 7) == 0)
|
||||
{
|
||||
arguments += 7;
|
||||
while (arguments[0] == ' ')
|
||||
@@ -1418,7 +1418,7 @@ weechat_cmd_key (char *arguments)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (arguments, "functions") == 0)
|
||||
else if (ascii_strcasecmp (arguments, "functions") == 0)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Internal key functions:\n"));
|
||||
@@ -1431,12 +1431,12 @@ weechat_cmd_key (char *arguments)
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "reset", 5) == 0)
|
||||
else if (ascii_strncasecmp (arguments, "reset", 5) == 0)
|
||||
{
|
||||
arguments += 5;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (strcasecmp (arguments, "-yes") == 0)
|
||||
if (ascii_strcasecmp (arguments, "-yes") == 0)
|
||||
{
|
||||
gui_key_free_all ();
|
||||
gui_key_init ();
|
||||
@@ -1570,18 +1570,18 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcasecmp (argv[0], "autoload") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
|
||||
else if (strcasecmp (argv[0], "reload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
{
|
||||
plugin_unload (PLUGIN_TYPE_PERL, NULL);
|
||||
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
|
||||
}
|
||||
else if (strcasecmp (argv[0], "unload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "unload") == 0)
|
||||
plugin_unload (PLUGIN_TYPE_PERL, NULL);
|
||||
break;
|
||||
case 2:
|
||||
if (strcasecmp (argv[0], "load") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
{
|
||||
/* load Perl script */
|
||||
if (strstr(argv[1], DIR_SEPARATOR))
|
||||
@@ -1713,18 +1713,18 @@ weechat_cmd_python (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcasecmp (argv[0], "autoload") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
|
||||
else if (strcasecmp (argv[0], "reload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
{
|
||||
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
|
||||
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
|
||||
}
|
||||
else if (strcasecmp (argv[0], "unload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "unload") == 0)
|
||||
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
|
||||
break;
|
||||
case 2:
|
||||
if (strcasecmp (argv[0], "load") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
{
|
||||
/* load Python script */
|
||||
if (strstr(argv[1], DIR_SEPARATOR))
|
||||
@@ -1856,18 +1856,18 @@ weechat_cmd_ruby (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcasecmp (argv[0], "autoload") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
|
||||
else if (strcasecmp (argv[0], "reload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
{
|
||||
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
|
||||
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
|
||||
}
|
||||
else if (strcasecmp (argv[0], "unload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "unload") == 0)
|
||||
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
|
||||
break;
|
||||
case 2:
|
||||
if (strcasecmp (argv[0], "load") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
{
|
||||
/* load Ruby script */
|
||||
if (strstr(argv[1], DIR_SEPARATOR))
|
||||
@@ -1967,7 +1967,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "del") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "del") == 0)
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
@@ -2067,15 +2067,15 @@ weechat_cmd_server (int argc, char **argv)
|
||||
{
|
||||
if (argv[i][0] == '-')
|
||||
{
|
||||
if (strcasecmp (argv[i], "-auto") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-auto") == 0)
|
||||
server.autoconnect = 1;
|
||||
if (strcasecmp (argv[i], "-noauto") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-noauto") == 0)
|
||||
server.autoconnect = 0;
|
||||
if (strcasecmp (argv[i], "-ipv6") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-ipv6") == 0)
|
||||
server.ipv6 = 1;
|
||||
if (strcasecmp (argv[i], "-ssl") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-ssl") == 0)
|
||||
server.ssl = 1;
|
||||
if (strcasecmp (argv[i], "-pwd") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-pwd") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2088,7 +2088,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.password = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-nicks") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-nicks") == 0)
|
||||
{
|
||||
if (i >= (argc - 3))
|
||||
{
|
||||
@@ -2103,7 +2103,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
server.nick2 = strdup (argv[++i]);
|
||||
server.nick3 = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-username") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-username") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2116,7 +2116,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.username = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-realname") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-realname") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2129,7 +2129,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.realname = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-command") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-command") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2142,7 +2142,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.command = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-autojoin") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-autojoin") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2529,7 +2529,7 @@ weechat_cmd_window (int argc, char **argv)
|
||||
t_gui_window *ptr_win;
|
||||
int i;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened windows */
|
||||
|
||||
@@ -2558,29 +2558,29 @@ weechat_cmd_window (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "splith") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "splith") == 0)
|
||||
{
|
||||
/* split window horizontally */
|
||||
gui_window_split_horiz (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "splitv") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "splitv") == 0)
|
||||
{
|
||||
/* split window vertically */
|
||||
gui_window_split_vertic (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "merge") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "merge") == 0)
|
||||
{
|
||||
if (argc >= 2)
|
||||
{
|
||||
if (strcasecmp (argv[1], "down") == 0)
|
||||
if (ascii_strcasecmp (argv[1], "down") == 0)
|
||||
gui_window_merge_down (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "up") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "up") == 0)
|
||||
gui_window_merge_up (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "left") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "left") == 0)
|
||||
gui_window_merge_left (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "right") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "right") == 0)
|
||||
gui_window_merge_right (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "all") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "all") == 0)
|
||||
gui_window_merge_all (gui_current_window);
|
||||
else
|
||||
{
|
||||
@@ -2594,9 +2594,9 @@ weechat_cmd_window (int argc, char **argv)
|
||||
else
|
||||
gui_window_merge_auto (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "-1") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "-1") == 0)
|
||||
gui_switch_to_previous_window ();
|
||||
else if (strcasecmp (argv[0], "+1") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "+1") == 0)
|
||||
gui_switch_to_next_window ();
|
||||
else
|
||||
{
|
||||
|
||||
+58
-58
@@ -111,13 +111,13 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
/* WeeChat internal commands */
|
||||
|
||||
/* no completion for some commands */
|
||||
if ((strcasecmp (completion->base_command, "server") == 0)
|
||||
|| (strcasecmp (completion->base_command, "save") == 0))
|
||||
if ((ascii_strcasecmp (completion->base_command, "server") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "save") == 0))
|
||||
{
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "alias") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "alias") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
|
||||
@@ -128,7 +128,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "buffer") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "buffer") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -145,7 +145,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"notify");
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "clear") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "clear") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -153,8 +153,8 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"-all");
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "connect") == 0)
|
||||
|| (strcasecmp (completion->base_command, "disconnect") == 0))
|
||||
if ((ascii_strcasecmp (completion->base_command, "connect") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "disconnect") == 0))
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "debug") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "debug") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -183,7 +183,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "help") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "help") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
@@ -201,7 +201,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "key") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "key") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -229,8 +229,8 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (((strcasecmp (completion->base_command, "perl") == 0)
|
||||
|| (strcasecmp (completion->base_command, "python") == 0))
|
||||
if (((ascii_strcasecmp (completion->base_command, "perl") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "python") == 0))
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -247,7 +247,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"unload");
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "set") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "set") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -340,7 +340,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "unalias") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "unalias") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
|
||||
@@ -351,7 +351,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "window") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "window") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -397,33 +397,33 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
/* IRC commands */
|
||||
|
||||
/* no completion for some commands */
|
||||
if ((strcasecmp (completion->base_command, "admin") == 0)
|
||||
|| (strcasecmp (completion->base_command, "die") == 0)
|
||||
|| (strcasecmp (completion->base_command, "info") == 0)
|
||||
|| (strcasecmp (completion->base_command, "join") == 0)
|
||||
|| (strcasecmp (completion->base_command, "links") == 0)
|
||||
|| (strcasecmp (completion->base_command, "list") == 0)
|
||||
|| (strcasecmp (completion->base_command, "lusers") == 0)
|
||||
|| (strcasecmp (completion->base_command, "motd") == 0)
|
||||
|| (strcasecmp (completion->base_command, "oper") == 0)
|
||||
|| (strcasecmp (completion->base_command, "rehash") == 0)
|
||||
|| (strcasecmp (completion->base_command, "restart") == 0)
|
||||
|| (strcasecmp (completion->base_command, "service") == 0)
|
||||
|| (strcasecmp (completion->base_command, "servlist") == 0)
|
||||
|| (strcasecmp (completion->base_command, "squery") == 0)
|
||||
|| (strcasecmp (completion->base_command, "squit") == 0)
|
||||
|| (strcasecmp (completion->base_command, "stats") == 0)
|
||||
|| (strcasecmp (completion->base_command, "summon") == 0)
|
||||
|| (strcasecmp (completion->base_command, "time") == 0)
|
||||
|| (strcasecmp (completion->base_command, "trace") == 0)
|
||||
|| (strcasecmp (completion->base_command, "users") == 0)
|
||||
|| (strcasecmp (completion->base_command, "wallops") == 0)
|
||||
|| (strcasecmp (completion->base_command, "who") == 0))
|
||||
if ((ascii_strcasecmp (completion->base_command, "admin") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "die") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "info") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "join") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "links") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "list") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "lusers") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "motd") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "oper") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "rehash") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "restart") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "service") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "servlist") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "squery") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "squit") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "stats") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "summon") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "time") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "trace") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "users") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "wallops") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "who") == 0))
|
||||
{
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "away") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "away") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0])
|
||||
@@ -432,7 +432,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
cfg_irc_default_msg_away);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "ctcp") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "ctcp") == 0)
|
||||
&& (completion->base_command_arg == 2))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -446,7 +446,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"version");
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "dcc") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "dcc") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -460,7 +460,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"close");
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "invite") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "invite") == 0)
|
||||
{
|
||||
/* arg1: nickname */
|
||||
if (completion->base_command_arg == 1)
|
||||
@@ -486,30 +486,30 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "kick") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "kick") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "kill") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "kill") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "me") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "me") == 0)
|
||||
{
|
||||
completion->context = COMPLETION_NICK;
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "notice") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "notice") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "part") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "part") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
|
||||
@@ -518,13 +518,13 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
cfg_irc_default_msg_part);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "query") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "query") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "quit") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "quit") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
|
||||
@@ -533,7 +533,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
cfg_irc_default_msg_quit);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "topic") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "topic") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -717,7 +717,7 @@ completion_command (t_completion *completion)
|
||||
other_completion = 0;
|
||||
for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
|
||||
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
|
||||
{
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
@@ -725,7 +725,7 @@ completion_command (t_completion *completion)
|
||||
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist2->data,
|
||||
if (ascii_strncasecmp (ptr_weelist2->data,
|
||||
completion->base_word + 1, length) == 0)
|
||||
other_completion++;
|
||||
}
|
||||
@@ -739,7 +739,7 @@ completion_command (t_completion *completion)
|
||||
other_completion++;
|
||||
}
|
||||
if (completion->word_found &&
|
||||
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
}
|
||||
if (completion->word_found)
|
||||
@@ -765,7 +765,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
|
||||
for (ptr_weelist = completion->completion_list; ptr_weelist;
|
||||
ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
|
||||
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
|
||||
{
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
@@ -773,7 +773,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
|
||||
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist2->data,
|
||||
if (ascii_strncasecmp (ptr_weelist2->data,
|
||||
completion->base_word, length) == 0)
|
||||
other_completion++;
|
||||
}
|
||||
@@ -787,7 +787,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
|
||||
other_completion++;
|
||||
}
|
||||
if (completion->word_found &&
|
||||
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
}
|
||||
if (completion->word_found)
|
||||
@@ -821,7 +821,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
|
||||
other_completion = 0;
|
||||
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
if (strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
|
||||
if (ascii_strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
|
||||
{
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
@@ -829,7 +829,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
|
||||
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
|
||||
ptr_nick2 = ptr_nick2->next_nick)
|
||||
{
|
||||
if (strncasecmp (ptr_nick2->nick,
|
||||
if (ascii_strncasecmp (ptr_nick2->nick,
|
||||
completion->base_word, length) == 0)
|
||||
other_completion++;
|
||||
}
|
||||
@@ -843,7 +843,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
|
||||
other_completion++;
|
||||
}
|
||||
if (completion->word_found &&
|
||||
(strcasecmp (ptr_nick->nick, completion->word_found) == 0))
|
||||
(ascii_strcasecmp (ptr_nick->nick, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
}
|
||||
if (completion->word_found)
|
||||
|
||||
+74
-2
@@ -83,6 +83,78 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* ascii_strcasecmp: locale and case independent string comparison
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strcasecmp (char *string1, char *string2)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
while (string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
}
|
||||
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* ascii_strncasecmp: locale and case independent string comparison
|
||||
* with max length
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strncasecmp (char *string1, char *string2, int max)
|
||||
{
|
||||
int c1, c2, count;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
count = 0;
|
||||
while ((count < max) && string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count >= max)
|
||||
return 0;
|
||||
else
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
|
||||
*/
|
||||
@@ -131,7 +203,7 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
|
||||
size_t inbytesleft, outbytesleft;
|
||||
|
||||
if (from_code && from_code[0] && to_code && to_code[0]
|
||||
&& (strcasecmp(from_code, to_code) != 0))
|
||||
&& (ascii_strcasecmp(from_code, to_code) != 0))
|
||||
{
|
||||
cd = iconv_open (to_code, from_code);
|
||||
if (cd == (iconv_t)(-1))
|
||||
@@ -418,7 +490,7 @@ wee_parse_args (int argc, char *argv[])
|
||||
wee_display_commands (1, 0);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strncasecmp (argv[i], "irc", 3) == 0))
|
||||
else if ((ascii_strncasecmp (argv[i], "irc", 3) == 0))
|
||||
{
|
||||
if (server_init_with_url (argv[i], &server_tmp) < 0)
|
||||
{
|
||||
|
||||
@@ -118,6 +118,8 @@ extern char *local_charset;
|
||||
extern gnutls_certificate_credentials gnutls_xcred;
|
||||
#endif
|
||||
|
||||
extern int ascii_strcasecmp (char *, char *);
|
||||
extern int ascii_strncasecmp (char *, char *, int);
|
||||
extern void wee_log_printf (char *, ...);
|
||||
extern void wee_dump (int);
|
||||
extern char *weechat_convert_encoding (char *, char *, char *);
|
||||
|
||||
+26
-26
@@ -775,7 +775,7 @@ get_pos_array_values (char **array, char *string)
|
||||
i = 0;
|
||||
while (array[i])
|
||||
{
|
||||
if (strcasecmp (array[i], string) == 0)
|
||||
if (ascii_strcasecmp (array[i], string) == 0)
|
||||
return i;
|
||||
i++;
|
||||
}
|
||||
@@ -926,9 +926,9 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
switch (option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (strcasecmp (value, "on") == 0)
|
||||
if (ascii_strcasecmp (value, "on") == 0)
|
||||
*(option->ptr_int) = BOOL_TRUE;
|
||||
else if (strcasecmp (value, "off") == 0)
|
||||
else if (ascii_strcasecmp (value, "off") == 0)
|
||||
*(option->ptr_int) = BOOL_FALSE;
|
||||
else
|
||||
return -1;
|
||||
@@ -965,43 +965,43 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
void *
|
||||
config_get_server_option_ptr (t_irc_server *server, char *option_name)
|
||||
{
|
||||
if (strcasecmp (option_name, "server_name") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_name") == 0)
|
||||
return (void *)(&server->name);
|
||||
if (strcasecmp (option_name, "server_autoconnect") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autoconnect") == 0)
|
||||
return (void *)(&server->autoconnect);
|
||||
if (strcasecmp (option_name, "server_autoreconnect") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autoreconnect") == 0)
|
||||
return (void *)(&server->autoreconnect);
|
||||
if (strcasecmp (option_name, "server_autoreconnect_delay") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autoreconnect_delay") == 0)
|
||||
return (void *)(&server->autoreconnect_delay);
|
||||
if (strcasecmp (option_name, "server_address") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_address") == 0)
|
||||
return (void *)(&server->address);
|
||||
if (strcasecmp (option_name, "server_port") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_port") == 0)
|
||||
return (void *)(&server->port);
|
||||
if (strcasecmp (option_name, "server_ipv6") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_ipv6") == 0)
|
||||
return (void *)(&server->ipv6);
|
||||
if (strcasecmp (option_name, "server_ssl") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_ssl") == 0)
|
||||
return (void *)(&server->ssl);
|
||||
if (strcasecmp (option_name, "server_password") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_password") == 0)
|
||||
return (void *)(&server->password);
|
||||
if (strcasecmp (option_name, "server_nick1") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_nick1") == 0)
|
||||
return (void *)(&server->nick1);
|
||||
if (strcasecmp (option_name, "server_nick2") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_nick2") == 0)
|
||||
return (void *)(&server->nick2);
|
||||
if (strcasecmp (option_name, "server_nick3") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_nick3") == 0)
|
||||
return (void *)(&server->nick3);
|
||||
if (strcasecmp (option_name, "server_username") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_username") == 0)
|
||||
return (void *)(&server->username);
|
||||
if (strcasecmp (option_name, "server_realname") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_realname") == 0)
|
||||
return (void *)(&server->realname);
|
||||
if (strcasecmp (option_name, "server_command") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_command") == 0)
|
||||
return (void *)(&server->command);
|
||||
if (strcasecmp (option_name, "server_command_delay") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_command_delay") == 0)
|
||||
return (void *)(&server->command_delay);
|
||||
if (strcasecmp (option_name, "server_autojoin") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autojoin") == 0)
|
||||
return (void *)(&server->autojoin);
|
||||
if (strcasecmp (option_name, "server_autorejoin") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autorejoin") == 0)
|
||||
return (void *)(&server->autorejoin);
|
||||
if (strcasecmp (option_name, "server_notify_levels") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_notify_levels") == 0)
|
||||
return (void *)(&server->notify_levels);
|
||||
/* option not found */
|
||||
return NULL;
|
||||
@@ -1031,7 +1031,7 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
|
||||
{
|
||||
/* if option found, return pointer */
|
||||
if (strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
|
||||
if (ascii_strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
|
||||
{
|
||||
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
|
||||
break;
|
||||
@@ -1043,9 +1043,9 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
switch (ptr_option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (strcasecmp (value, "on") == 0)
|
||||
if (ascii_strcasecmp (value, "on") == 0)
|
||||
*((int *)(ptr_data)) = BOOL_TRUE;
|
||||
else if (strcasecmp (value, "off") == 0)
|
||||
else if (ascii_strcasecmp (value, "off") == 0)
|
||||
*((int *)(ptr_data)) = BOOL_FALSE;
|
||||
else
|
||||
return -2;
|
||||
@@ -1095,7 +1095,7 @@ config_option_search (char *option_name)
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
/* if option found, return pointer */
|
||||
if (strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
|
||||
if (ascii_strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
|
||||
return &weechat_options[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ weelist_search (t_weelist *weelist, char *data)
|
||||
|
||||
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strcasecmp (data, ptr_weelist->data) == 0)
|
||||
if (ascii_strcasecmp (data, ptr_weelist->data) == 0)
|
||||
return ptr_weelist;
|
||||
}
|
||||
/* word not found in list */
|
||||
@@ -60,7 +60,7 @@ weelist_find_pos (t_weelist *weelist, char *data)
|
||||
|
||||
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strcasecmp (data, ptr_weelist->data) < 0)
|
||||
if (ascii_strcasecmp (data, ptr_weelist->data) < 0)
|
||||
return ptr_weelist;
|
||||
}
|
||||
/* position not found, best position is at the end */
|
||||
|
||||
@@ -80,7 +80,7 @@ gui_assign_color (int *color, char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
{
|
||||
*color = gui_colors[i].color;
|
||||
return 1;
|
||||
@@ -105,7 +105,7 @@ gui_get_color_by_name (char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
return gui_colors[i].color;
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ gui_assign_color (int *color, char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
{
|
||||
*color = gui_colors[i].color;
|
||||
return 1;
|
||||
@@ -114,7 +114,7 @@ gui_get_color_by_name (char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
return gui_colors[i].color;
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -157,17 +157,17 @@ gui_key_get_internal_code (char *key)
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "meta2-", 6) == 0)
|
||||
if (ascii_strncasecmp (key, "meta2-", 6) == 0)
|
||||
{
|
||||
strcat (result, "^[[");
|
||||
key += 6;
|
||||
}
|
||||
if (strncasecmp (key, "meta-", 5) == 0)
|
||||
if (ascii_strncasecmp (key, "meta-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^[");
|
||||
key += 5;
|
||||
}
|
||||
else if (strncasecmp (key, "ctrl-", 5) == 0)
|
||||
else if (ascii_strncasecmp (key, "ctrl-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^");
|
||||
key += 5;
|
||||
@@ -200,12 +200,12 @@ gui_key_get_expanded_name (char *key)
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "^[[", 3) == 0)
|
||||
if (ascii_strncasecmp (key, "^[[", 3) == 0)
|
||||
{
|
||||
strcat (result, "meta2-");
|
||||
key += 3;
|
||||
}
|
||||
if (strncasecmp (key, "^[", 2) == 0)
|
||||
if (ascii_strncasecmp (key, "^[", 2) == 0)
|
||||
{
|
||||
strcat (result, "meta-");
|
||||
key += 2;
|
||||
@@ -239,7 +239,7 @@ gui_key_find_pos (t_gui_key *key)
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (key->key, ptr_key->key) < 0)
|
||||
if (ascii_strcasecmp (key->key, ptr_key->key) < 0)
|
||||
return ptr_key;
|
||||
}
|
||||
return NULL;
|
||||
@@ -324,7 +324,7 @@ gui_key_search (char *key)
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, key) == 0)
|
||||
if (ascii_strcasecmp (ptr_key->key, key) == 0)
|
||||
return ptr_key;
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ gui_key_function_search_by_name (char *name)
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
if (strcasecmp (gui_key_functions[i].function_name, name) == 0)
|
||||
if (ascii_strcasecmp (gui_key_functions[i].function_name, name) == 0)
|
||||
return gui_key_functions[i].function;
|
||||
i++;
|
||||
}
|
||||
@@ -504,7 +504,7 @@ gui_key_pressed (char *key_str)
|
||||
ptr_key = gui_key_search_part (gui_key_buffer);
|
||||
if (ptr_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, gui_key_buffer) == 0)
|
||||
if (ascii_strcasecmp (ptr_key->key, gui_key_buffer) == 0)
|
||||
{
|
||||
/* exact combo found => execute function or command */
|
||||
gui_key_buffer[0] = '\0';
|
||||
|
||||
@@ -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;
|
||||
|
||||
+6
-7
@@ -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;
|
||||
|
||||
+6
-6
@@ -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,
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
+18
-18
@@ -73,7 +73,7 @@ static XS (XS_IRC_register)
|
||||
for (ptr_perl_script = perl_scripts; ptr_perl_script;
|
||||
ptr_perl_script = ptr_perl_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
{
|
||||
perl_script_found = ptr_perl_script;
|
||||
break;
|
||||
@@ -182,12 +182,12 @@ static XS (XS_IRC_print_with_channel)
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (!server || (strcasecmp (ptr_server->name, server)) == 0)
|
||||
if (!server || (ascii_strcasecmp (ptr_server->name, server)) == 0)
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (strcasecmp (ptr_channel->name, channel) == 0)
|
||||
if (ascii_strcasecmp (ptr_channel->name, channel) == 0)
|
||||
{
|
||||
ptr_buffer = ptr_channel->buffer;
|
||||
break;
|
||||
@@ -260,7 +260,7 @@ static XS (XS_IRC_command)
|
||||
command = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
if (ascii_strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
@@ -383,30 +383,30 @@ static XS (XS_IRC_get_info)
|
||||
|
||||
if (arg)
|
||||
{
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) ) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) ) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
@@ -448,7 +448,7 @@ static XS (XS_weechat_register)
|
||||
for (ptr_perl_script = perl_scripts; ptr_perl_script;
|
||||
ptr_perl_script = ptr_perl_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
{
|
||||
perl_script_found = ptr_perl_script;
|
||||
break;
|
||||
@@ -731,36 +731,36 @@ static XS (XS_weechat_get_info)
|
||||
arg = SvPV (ST (0), integer);
|
||||
if (arg)
|
||||
{
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) ) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) ) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
return;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "100") == 0) || (ascii_strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
int nItems = 0;
|
||||
t_irc_dcc *p = dcc_list;
|
||||
|
||||
@@ -181,7 +181,7 @@ plugin_handler_search (t_plugin_handler *plugin_handlers, char *name)
|
||||
ptr_plugin_handler = ptr_plugin_handler->next_handler)
|
||||
{
|
||||
/* handler found */
|
||||
if (strcasecmp (ptr_plugin_handler->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_plugin_handler->name, name) == 0)
|
||||
return ptr_plugin_handler;
|
||||
}
|
||||
/* handler not found */
|
||||
@@ -309,7 +309,7 @@ plugin_event_msg (char *irc_command, char *server, char *arguments)
|
||||
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
|
||||
ptr_plugin_handler = ptr_plugin_handler->next_handler)
|
||||
{
|
||||
if (strcasecmp (ptr_plugin_handler->name, irc_command) == 0)
|
||||
if (ascii_strcasecmp (ptr_plugin_handler->name, irc_command) == 0)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
@@ -367,7 +367,7 @@ plugin_exec_command (char *user_command, char *server, char *arguments)
|
||||
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
|
||||
ptr_plugin_handler = ptr_plugin_handler->next_handler)
|
||||
{
|
||||
if (strcasecmp (ptr_plugin_handler->name, user_command) == 0)
|
||||
if (ascii_strcasecmp (ptr_plugin_handler->name, user_command) == 0)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
|
||||
@@ -66,7 +66,7 @@ wee_python_register (PyObject *self, PyObject *args)
|
||||
for (ptr_python_script = python_scripts; ptr_python_script;
|
||||
ptr_python_script = ptr_python_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_python_script->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_python_script->name, name) == 0)
|
||||
{
|
||||
python_script_found = ptr_python_script;
|
||||
break;
|
||||
@@ -321,7 +321,7 @@ wee_python_get_info (PyObject *self, PyObject *args)
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
if (ascii_strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
@@ -336,34 +336,34 @@ wee_python_get_info (PyObject *self, PyObject *args)
|
||||
|
||||
if (ptr_server && arg)
|
||||
{
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) )
|
||||
{
|
||||
return Py_BuildValue ("i", SERVER(gui_current_window->buffer)->is_away);
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "100") == 0) || (ascii_strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
t_irc_dcc *p = dcc_list;
|
||||
int nbdccs = 0;
|
||||
|
||||
@@ -74,7 +74,7 @@ wee_ruby_register (VALUE class, VALUE name, VALUE version, VALUE shutdown_func,
|
||||
for (ptr_ruby_script = ruby_scripts; ptr_ruby_script;
|
||||
ptr_ruby_script = ptr_ruby_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_ruby_script->name, c_name) == 0)
|
||||
if (ascii_strcasecmp (ptr_ruby_script->name, c_name) == 0)
|
||||
{
|
||||
ruby_script_found = ptr_ruby_script;
|
||||
break;
|
||||
@@ -357,7 +357,7 @@ wee_ruby_get_info (VALUE class, VALUE arg, VALUE server_name)
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, c_server_name) == 0)
|
||||
if (ascii_strcasecmp (ptr_server->name, c_server_name) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
@@ -372,34 +372,34 @@ wee_ruby_get_info (VALUE class, VALUE arg, VALUE server_name)
|
||||
|
||||
if (ptr_server && c_arg)
|
||||
{
|
||||
if ( (strcasecmp (c_arg, "0") == 0) || (strcasecmp (c_arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (c_arg, "0") == 0) || (ascii_strcasecmp (c_arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "1") == 0) || (strcasecmp (c_arg, "nick") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "1") == 0) || (ascii_strcasecmp (c_arg, "nick") == 0) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "2") == 0) || (strcasecmp (c_arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "2") == 0) || (ascii_strcasecmp (c_arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "3") == 0) || (strcasecmp (c_arg, "server") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "3") == 0) || (ascii_strcasecmp (c_arg, "server") == 0) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "4") == 0) || (strcasecmp (c_arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "4") == 0) || (ascii_strcasecmp (c_arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "5") == 0) || (strcasecmp (c_arg, "away") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "5") == 0) || (ascii_strcasecmp (c_arg, "away") == 0) )
|
||||
{
|
||||
return INT2FIX (SERVER(gui_current_window->buffer)->is_away);
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "100") == 0) || (strcasecmp (c_arg, "dccs") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "100") == 0) || (ascii_strcasecmp (c_arg, "dccs") == 0) )
|
||||
{
|
||||
/* TODO: build dcc list */
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-09-02
|
||||
ChangeLog - 2005-09-03
|
||||
|
||||
|
||||
Version 0.1.5 (under dev!):
|
||||
* fixed bug with strings comparison (str[n]casecmp) and some locales
|
||||
(like turkish), now using ASCII comparison (thanks to roktas)
|
||||
* signal SIGQUIT is now ignored
|
||||
* fixed refresh bug when one line is bigger than screen size
|
||||
* fixed look_nicklist_min_size and look_nicklist_max_size options
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.1.5-cvs\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2005-08-21 14:31+0200\n"
|
||||
"PO-Revision-Date: 2005-08-21 14:31+0200\n"
|
||||
"PO-Revision-Date: 2005-09-03 13:24+0200\n"
|
||||
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -2673,7 +2673,7 @@ msgstr "%s l'alias ou la commande \"%s\" existe d
|
||||
#: src/common/command.c:282
|
||||
#, c-format
|
||||
msgid "%s alias cannot run another alias!\n"
|
||||
msgstr "%s l'alias ne peux pas lancer un autre alias !\n"
|
||||
msgstr "%s l'alias ne peut pas lancer un autre alias !\n"
|
||||
|
||||
#: src/common/command.c:289
|
||||
#, c-format
|
||||
|
||||
@@ -191,7 +191,7 @@ alias_search (char *alias_name)
|
||||
|
||||
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
if (strcasecmp (alias_name, ptr_alias->alias_name) == 0)
|
||||
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) == 0)
|
||||
return ptr_alias;
|
||||
}
|
||||
return NULL;
|
||||
@@ -208,7 +208,7 @@ alias_find_pos (char *alias_name)
|
||||
|
||||
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
if (strcasecmp (alias_name, ptr_alias->alias_name) < 0)
|
||||
if (ascii_strcasecmp (alias_name, ptr_alias->alias_name) < 0)
|
||||
return ptr_alias;
|
||||
}
|
||||
return NULL;
|
||||
@@ -484,7 +484,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
{
|
||||
if (strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
|
||||
if (ascii_strcasecmp (weechat_commands[i].command_name, command + 1) == 0)
|
||||
{
|
||||
if ((argc < weechat_commands[i].min_arg)
|
||||
|| (argc > weechat_commands[i].max_arg))
|
||||
@@ -544,7 +544,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
}
|
||||
for (i = 0; irc_commands[i].command_name; i++)
|
||||
{
|
||||
if ((strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
|
||||
if ((ascii_strcasecmp (irc_commands[i].command_name, command + 1) == 0) &&
|
||||
((irc_commands[i].cmd_function_args) ||
|
||||
(irc_commands[i].cmd_function_1arg)))
|
||||
{
|
||||
@@ -615,7 +615,7 @@ exec_weechat_command (t_irc_server *server, char *string)
|
||||
for (ptr_alias = weechat_alias; ptr_alias;
|
||||
ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
if (strcasecmp (ptr_alias->alias_name, command + 1) == 0)
|
||||
if (ascii_strcasecmp (ptr_alias->alias_name, command + 1) == 0)
|
||||
{
|
||||
if (ptr_args)
|
||||
{
|
||||
@@ -890,7 +890,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
char *error;
|
||||
int target_buffer;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened buffers */
|
||||
|
||||
@@ -908,7 +908,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "move") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "move") == 0)
|
||||
{
|
||||
/* move buffer to another number in the list */
|
||||
|
||||
@@ -943,7 +943,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (argv[0], "close") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "close") == 0)
|
||||
{
|
||||
/* close buffer (server or channel/private) */
|
||||
|
||||
@@ -995,7 +995,7 @@ weechat_cmd_buffer (int argc, char **argv)
|
||||
}
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "notify") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "notify") == 0)
|
||||
{
|
||||
/* set notify level for buffer */
|
||||
|
||||
@@ -1114,7 +1114,7 @@ weechat_cmd_clear (int argc, char **argv)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
if (strcasecmp (argv[0], "-all") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "-all") == 0)
|
||||
gui_buffer_clear_all ();
|
||||
else
|
||||
{
|
||||
@@ -1198,7 +1198,7 @@ weechat_cmd_debug (int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strcasecmp (argv[0], "dump") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "dump") == 0)
|
||||
{
|
||||
wee_dump (0);
|
||||
}
|
||||
@@ -1294,7 +1294,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
{
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
{
|
||||
if (strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
|
||||
if (ascii_strcasecmp (weechat_commands[i].command_name, argv[0]) == 0)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, "[w]");
|
||||
@@ -1319,7 +1319,7 @@ weechat_cmd_help (int argc, char **argv)
|
||||
}
|
||||
for (i = 0; irc_commands[i].command_name; i++)
|
||||
{
|
||||
if ((strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
|
||||
if ((ascii_strcasecmp (irc_commands[i].command_name, argv[0]) == 0)
|
||||
&& (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg))
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
@@ -1402,7 +1402,7 @@ weechat_cmd_key (char *arguments)
|
||||
weechat_cmd_key_display (ptr_key, 0);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "unbind ", 7) == 0)
|
||||
else if (ascii_strncasecmp (arguments, "unbind ", 7) == 0)
|
||||
{
|
||||
arguments += 7;
|
||||
while (arguments[0] == ' ')
|
||||
@@ -1418,7 +1418,7 @@ weechat_cmd_key (char *arguments)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp (arguments, "functions") == 0)
|
||||
else if (ascii_strcasecmp (arguments, "functions") == 0)
|
||||
{
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("Internal key functions:\n"));
|
||||
@@ -1431,12 +1431,12 @@ weechat_cmd_key (char *arguments)
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else if (strncasecmp (arguments, "reset", 5) == 0)
|
||||
else if (ascii_strncasecmp (arguments, "reset", 5) == 0)
|
||||
{
|
||||
arguments += 5;
|
||||
while (arguments[0] == ' ')
|
||||
arguments++;
|
||||
if (strcasecmp (arguments, "-yes") == 0)
|
||||
if (ascii_strcasecmp (arguments, "-yes") == 0)
|
||||
{
|
||||
gui_key_free_all ();
|
||||
gui_key_init ();
|
||||
@@ -1570,18 +1570,18 @@ weechat_cmd_perl (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcasecmp (argv[0], "autoload") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
|
||||
else if (strcasecmp (argv[0], "reload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
{
|
||||
plugin_unload (PLUGIN_TYPE_PERL, NULL);
|
||||
plugin_auto_load (PLUGIN_TYPE_PERL, "perl/autoload");
|
||||
}
|
||||
else if (strcasecmp (argv[0], "unload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "unload") == 0)
|
||||
plugin_unload (PLUGIN_TYPE_PERL, NULL);
|
||||
break;
|
||||
case 2:
|
||||
if (strcasecmp (argv[0], "load") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
{
|
||||
/* load Perl script */
|
||||
if (strstr(argv[1], DIR_SEPARATOR))
|
||||
@@ -1713,18 +1713,18 @@ weechat_cmd_python (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcasecmp (argv[0], "autoload") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
|
||||
else if (strcasecmp (argv[0], "reload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
{
|
||||
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
|
||||
plugin_auto_load (PLUGIN_TYPE_PYTHON, "python/autoload");
|
||||
}
|
||||
else if (strcasecmp (argv[0], "unload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "unload") == 0)
|
||||
plugin_unload (PLUGIN_TYPE_PYTHON, NULL);
|
||||
break;
|
||||
case 2:
|
||||
if (strcasecmp (argv[0], "load") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
{
|
||||
/* load Python script */
|
||||
if (strstr(argv[1], DIR_SEPARATOR))
|
||||
@@ -1856,18 +1856,18 @@ weechat_cmd_ruby (int argc, char **argv)
|
||||
|
||||
break;
|
||||
case 1:
|
||||
if (strcasecmp (argv[0], "autoload") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "autoload") == 0)
|
||||
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
|
||||
else if (strcasecmp (argv[0], "reload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "reload") == 0)
|
||||
{
|
||||
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
|
||||
plugin_auto_load (PLUGIN_TYPE_RUBY, "ruby/autoload");
|
||||
}
|
||||
else if (strcasecmp (argv[0], "unload") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "unload") == 0)
|
||||
plugin_unload (PLUGIN_TYPE_RUBY, NULL);
|
||||
break;
|
||||
case 2:
|
||||
if (strcasecmp (argv[0], "load") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "load") == 0)
|
||||
{
|
||||
/* load Ruby script */
|
||||
if (strstr(argv[1], DIR_SEPARATOR))
|
||||
@@ -1967,7 +1967,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "del") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "del") == 0)
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
@@ -2067,15 +2067,15 @@ weechat_cmd_server (int argc, char **argv)
|
||||
{
|
||||
if (argv[i][0] == '-')
|
||||
{
|
||||
if (strcasecmp (argv[i], "-auto") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-auto") == 0)
|
||||
server.autoconnect = 1;
|
||||
if (strcasecmp (argv[i], "-noauto") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-noauto") == 0)
|
||||
server.autoconnect = 0;
|
||||
if (strcasecmp (argv[i], "-ipv6") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-ipv6") == 0)
|
||||
server.ipv6 = 1;
|
||||
if (strcasecmp (argv[i], "-ssl") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-ssl") == 0)
|
||||
server.ssl = 1;
|
||||
if (strcasecmp (argv[i], "-pwd") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-pwd") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2088,7 +2088,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.password = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-nicks") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-nicks") == 0)
|
||||
{
|
||||
if (i >= (argc - 3))
|
||||
{
|
||||
@@ -2103,7 +2103,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
server.nick2 = strdup (argv[++i]);
|
||||
server.nick3 = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-username") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-username") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2116,7 +2116,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.username = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-realname") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-realname") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2129,7 +2129,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.realname = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-command") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-command") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2142,7 +2142,7 @@ weechat_cmd_server (int argc, char **argv)
|
||||
}
|
||||
server.command = strdup (argv[++i]);
|
||||
}
|
||||
if (strcasecmp (argv[i], "-autojoin") == 0)
|
||||
if (ascii_strcasecmp (argv[i], "-autojoin") == 0)
|
||||
{
|
||||
if (i == (argc - 1))
|
||||
{
|
||||
@@ -2529,7 +2529,7 @@ weechat_cmd_window (int argc, char **argv)
|
||||
t_gui_window *ptr_win;
|
||||
int i;
|
||||
|
||||
if ((argc == 0) || ((argc == 1) && (strcasecmp (argv[0], "list") == 0)))
|
||||
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
|
||||
{
|
||||
/* list opened windows */
|
||||
|
||||
@@ -2558,29 +2558,29 @@ weechat_cmd_window (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcasecmp (argv[0], "splith") == 0)
|
||||
if (ascii_strcasecmp (argv[0], "splith") == 0)
|
||||
{
|
||||
/* split window horizontally */
|
||||
gui_window_split_horiz (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "splitv") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "splitv") == 0)
|
||||
{
|
||||
/* split window vertically */
|
||||
gui_window_split_vertic (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "merge") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "merge") == 0)
|
||||
{
|
||||
if (argc >= 2)
|
||||
{
|
||||
if (strcasecmp (argv[1], "down") == 0)
|
||||
if (ascii_strcasecmp (argv[1], "down") == 0)
|
||||
gui_window_merge_down (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "up") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "up") == 0)
|
||||
gui_window_merge_up (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "left") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "left") == 0)
|
||||
gui_window_merge_left (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "right") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "right") == 0)
|
||||
gui_window_merge_right (gui_current_window);
|
||||
else if (strcasecmp (argv[1], "all") == 0)
|
||||
else if (ascii_strcasecmp (argv[1], "all") == 0)
|
||||
gui_window_merge_all (gui_current_window);
|
||||
else
|
||||
{
|
||||
@@ -2594,9 +2594,9 @@ weechat_cmd_window (int argc, char **argv)
|
||||
else
|
||||
gui_window_merge_auto (gui_current_window);
|
||||
}
|
||||
else if (strcasecmp (argv[0], "-1") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "-1") == 0)
|
||||
gui_switch_to_previous_window ();
|
||||
else if (strcasecmp (argv[0], "+1") == 0)
|
||||
else if (ascii_strcasecmp (argv[0], "+1") == 0)
|
||||
gui_switch_to_next_window ();
|
||||
else
|
||||
{
|
||||
|
||||
@@ -111,13 +111,13 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
/* WeeChat internal commands */
|
||||
|
||||
/* no completion for some commands */
|
||||
if ((strcasecmp (completion->base_command, "server") == 0)
|
||||
|| (strcasecmp (completion->base_command, "save") == 0))
|
||||
if ((ascii_strcasecmp (completion->base_command, "server") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "save") == 0))
|
||||
{
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "alias") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "alias") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
|
||||
@@ -128,7 +128,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "buffer") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "buffer") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -145,7 +145,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"notify");
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "clear") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "clear") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -153,8 +153,8 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"-all");
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "connect") == 0)
|
||||
|| (strcasecmp (completion->base_command, "disconnect") == 0))
|
||||
if ((ascii_strcasecmp (completion->base_command, "connect") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "disconnect") == 0))
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "debug") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "debug") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -183,7 +183,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "help") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "help") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
for (i = 0; weechat_commands[i].command_name; i++)
|
||||
@@ -201,7 +201,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "key") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "key") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -229,8 +229,8 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (((strcasecmp (completion->base_command, "perl") == 0)
|
||||
|| (strcasecmp (completion->base_command, "python") == 0))
|
||||
if (((ascii_strcasecmp (completion->base_command, "perl") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "python") == 0))
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -247,7 +247,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"unload");
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "set") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "set") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -340,7 +340,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "unalias") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "unalias") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
|
||||
@@ -351,7 +351,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "window") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "window") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -397,33 +397,33 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
/* IRC commands */
|
||||
|
||||
/* no completion for some commands */
|
||||
if ((strcasecmp (completion->base_command, "admin") == 0)
|
||||
|| (strcasecmp (completion->base_command, "die") == 0)
|
||||
|| (strcasecmp (completion->base_command, "info") == 0)
|
||||
|| (strcasecmp (completion->base_command, "join") == 0)
|
||||
|| (strcasecmp (completion->base_command, "links") == 0)
|
||||
|| (strcasecmp (completion->base_command, "list") == 0)
|
||||
|| (strcasecmp (completion->base_command, "lusers") == 0)
|
||||
|| (strcasecmp (completion->base_command, "motd") == 0)
|
||||
|| (strcasecmp (completion->base_command, "oper") == 0)
|
||||
|| (strcasecmp (completion->base_command, "rehash") == 0)
|
||||
|| (strcasecmp (completion->base_command, "restart") == 0)
|
||||
|| (strcasecmp (completion->base_command, "service") == 0)
|
||||
|| (strcasecmp (completion->base_command, "servlist") == 0)
|
||||
|| (strcasecmp (completion->base_command, "squery") == 0)
|
||||
|| (strcasecmp (completion->base_command, "squit") == 0)
|
||||
|| (strcasecmp (completion->base_command, "stats") == 0)
|
||||
|| (strcasecmp (completion->base_command, "summon") == 0)
|
||||
|| (strcasecmp (completion->base_command, "time") == 0)
|
||||
|| (strcasecmp (completion->base_command, "trace") == 0)
|
||||
|| (strcasecmp (completion->base_command, "users") == 0)
|
||||
|| (strcasecmp (completion->base_command, "wallops") == 0)
|
||||
|| (strcasecmp (completion->base_command, "who") == 0))
|
||||
if ((ascii_strcasecmp (completion->base_command, "admin") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "die") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "info") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "join") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "links") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "list") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "lusers") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "motd") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "oper") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "rehash") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "restart") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "service") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "servlist") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "squery") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "squit") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "stats") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "summon") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "time") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "trace") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "users") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "wallops") == 0)
|
||||
|| (ascii_strcasecmp (completion->base_command, "who") == 0))
|
||||
{
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "away") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "away") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0])
|
||||
@@ -432,7 +432,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
cfg_irc_default_msg_away);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "ctcp") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "ctcp") == 0)
|
||||
&& (completion->base_command_arg == 2))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -446,7 +446,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"version");
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "dcc") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "dcc") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
weelist_add (&completion->completion_list,
|
||||
@@ -460,7 +460,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
"close");
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "invite") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "invite") == 0)
|
||||
{
|
||||
/* arg1: nickname */
|
||||
if (completion->base_command_arg == 1)
|
||||
@@ -486,30 +486,30 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "kick") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "kick") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "kill") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "kill") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "me") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "me") == 0)
|
||||
{
|
||||
completion->context = COMPLETION_NICK;
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "notice") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "notice") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "part") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "part") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
|
||||
@@ -518,13 +518,13 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
cfg_irc_default_msg_part);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "query") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "query") == 0)
|
||||
{
|
||||
if (completion->base_command_arg != 1)
|
||||
completion_stop (completion);
|
||||
return;
|
||||
}
|
||||
if ((strcasecmp (completion->base_command, "quit") == 0)
|
||||
if ((ascii_strcasecmp (completion->base_command, "quit") == 0)
|
||||
&& (completion->base_command_arg == 1))
|
||||
{
|
||||
if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
|
||||
@@ -533,7 +533,7 @@ completion_build_list (t_completion *completion, void *channel)
|
||||
cfg_irc_default_msg_quit);
|
||||
return;
|
||||
}
|
||||
if (strcasecmp (completion->base_command, "topic") == 0)
|
||||
if (ascii_strcasecmp (completion->base_command, "topic") == 0)
|
||||
{
|
||||
if (completion->base_command_arg == 1)
|
||||
{
|
||||
@@ -717,7 +717,7 @@ completion_command (t_completion *completion)
|
||||
other_completion = 0;
|
||||
for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
|
||||
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
|
||||
{
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
@@ -725,7 +725,7 @@ completion_command (t_completion *completion)
|
||||
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist2->data,
|
||||
if (ascii_strncasecmp (ptr_weelist2->data,
|
||||
completion->base_word + 1, length) == 0)
|
||||
other_completion++;
|
||||
}
|
||||
@@ -739,7 +739,7 @@ completion_command (t_completion *completion)
|
||||
other_completion++;
|
||||
}
|
||||
if (completion->word_found &&
|
||||
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
}
|
||||
if (completion->word_found)
|
||||
@@ -765,7 +765,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
|
||||
for (ptr_weelist = completion->completion_list; ptr_weelist;
|
||||
ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
|
||||
if (ascii_strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
|
||||
{
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
@@ -773,7 +773,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
|
||||
for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
|
||||
ptr_weelist2 = ptr_weelist2->next_weelist)
|
||||
{
|
||||
if (strncasecmp (ptr_weelist2->data,
|
||||
if (ascii_strncasecmp (ptr_weelist2->data,
|
||||
completion->base_word, length) == 0)
|
||||
other_completion++;
|
||||
}
|
||||
@@ -787,7 +787,7 @@ completion_command_arg (t_completion *completion, t_irc_channel *channel)
|
||||
other_completion++;
|
||||
}
|
||||
if (completion->word_found &&
|
||||
(strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
(ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
}
|
||||
if (completion->word_found)
|
||||
@@ -821,7 +821,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
|
||||
other_completion = 0;
|
||||
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
if (strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
|
||||
if (ascii_strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
|
||||
{
|
||||
if ((!completion->word_found) || word_found_seen)
|
||||
{
|
||||
@@ -829,7 +829,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
|
||||
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
|
||||
ptr_nick2 = ptr_nick2->next_nick)
|
||||
{
|
||||
if (strncasecmp (ptr_nick2->nick,
|
||||
if (ascii_strncasecmp (ptr_nick2->nick,
|
||||
completion->base_word, length) == 0)
|
||||
other_completion++;
|
||||
}
|
||||
@@ -843,7 +843,7 @@ completion_nick (t_completion *completion, t_irc_channel *channel)
|
||||
other_completion++;
|
||||
}
|
||||
if (completion->word_found &&
|
||||
(strcasecmp (ptr_nick->nick, completion->word_found) == 0))
|
||||
(ascii_strcasecmp (ptr_nick->nick, completion->word_found) == 0))
|
||||
word_found_seen = 1;
|
||||
}
|
||||
if (completion->word_found)
|
||||
|
||||
@@ -83,6 +83,78 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* ascii_strcasecmp: locale and case independent string comparison
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strcasecmp (char *string1, char *string2)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
while (string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
}
|
||||
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* ascii_strncasecmp: locale and case independent string comparison
|
||||
* with max length
|
||||
*/
|
||||
|
||||
int
|
||||
ascii_strncasecmp (char *string1, char *string2, int max)
|
||||
{
|
||||
int c1, c2, count;
|
||||
|
||||
if (!string1 || !string2)
|
||||
return (string1) ? 1 : ((string2) ? -1 : 0);
|
||||
|
||||
count = 0;
|
||||
while ((count < max) && string1[0] && string2[0])
|
||||
{
|
||||
c1 = (int)((unsigned char) string1[0]);
|
||||
c2 = (int)((unsigned char) string2[0]);
|
||||
|
||||
if ((c1 >= 'A') && (c1 <= 'Z'))
|
||||
c1 += ('a' - 'A');
|
||||
|
||||
if ((c2 >= 'A') && (c2 <= 'Z'))
|
||||
c2 += ('a' - 'A');
|
||||
|
||||
if ((c1 - c2) != 0)
|
||||
return c1 - c2;
|
||||
|
||||
string1++;
|
||||
string2++;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count >= max)
|
||||
return 0;
|
||||
else
|
||||
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
|
||||
*/
|
||||
@@ -131,7 +203,7 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
|
||||
size_t inbytesleft, outbytesleft;
|
||||
|
||||
if (from_code && from_code[0] && to_code && to_code[0]
|
||||
&& (strcasecmp(from_code, to_code) != 0))
|
||||
&& (ascii_strcasecmp(from_code, to_code) != 0))
|
||||
{
|
||||
cd = iconv_open (to_code, from_code);
|
||||
if (cd == (iconv_t)(-1))
|
||||
@@ -418,7 +490,7 @@ wee_parse_args (int argc, char *argv[])
|
||||
wee_display_commands (1, 0);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strncasecmp (argv[i], "irc", 3) == 0))
|
||||
else if ((ascii_strncasecmp (argv[i], "irc", 3) == 0))
|
||||
{
|
||||
if (server_init_with_url (argv[i], &server_tmp) < 0)
|
||||
{
|
||||
|
||||
@@ -118,6 +118,8 @@ extern char *local_charset;
|
||||
extern gnutls_certificate_credentials gnutls_xcred;
|
||||
#endif
|
||||
|
||||
extern int ascii_strcasecmp (char *, char *);
|
||||
extern int ascii_strncasecmp (char *, char *, int);
|
||||
extern void wee_log_printf (char *, ...);
|
||||
extern void wee_dump (int);
|
||||
extern char *weechat_convert_encoding (char *, char *, char *);
|
||||
|
||||
@@ -775,7 +775,7 @@ get_pos_array_values (char **array, char *string)
|
||||
i = 0;
|
||||
while (array[i])
|
||||
{
|
||||
if (strcasecmp (array[i], string) == 0)
|
||||
if (ascii_strcasecmp (array[i], string) == 0)
|
||||
return i;
|
||||
i++;
|
||||
}
|
||||
@@ -926,9 +926,9 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
switch (option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (strcasecmp (value, "on") == 0)
|
||||
if (ascii_strcasecmp (value, "on") == 0)
|
||||
*(option->ptr_int) = BOOL_TRUE;
|
||||
else if (strcasecmp (value, "off") == 0)
|
||||
else if (ascii_strcasecmp (value, "off") == 0)
|
||||
*(option->ptr_int) = BOOL_FALSE;
|
||||
else
|
||||
return -1;
|
||||
@@ -965,43 +965,43 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
void *
|
||||
config_get_server_option_ptr (t_irc_server *server, char *option_name)
|
||||
{
|
||||
if (strcasecmp (option_name, "server_name") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_name") == 0)
|
||||
return (void *)(&server->name);
|
||||
if (strcasecmp (option_name, "server_autoconnect") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autoconnect") == 0)
|
||||
return (void *)(&server->autoconnect);
|
||||
if (strcasecmp (option_name, "server_autoreconnect") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autoreconnect") == 0)
|
||||
return (void *)(&server->autoreconnect);
|
||||
if (strcasecmp (option_name, "server_autoreconnect_delay") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autoreconnect_delay") == 0)
|
||||
return (void *)(&server->autoreconnect_delay);
|
||||
if (strcasecmp (option_name, "server_address") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_address") == 0)
|
||||
return (void *)(&server->address);
|
||||
if (strcasecmp (option_name, "server_port") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_port") == 0)
|
||||
return (void *)(&server->port);
|
||||
if (strcasecmp (option_name, "server_ipv6") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_ipv6") == 0)
|
||||
return (void *)(&server->ipv6);
|
||||
if (strcasecmp (option_name, "server_ssl") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_ssl") == 0)
|
||||
return (void *)(&server->ssl);
|
||||
if (strcasecmp (option_name, "server_password") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_password") == 0)
|
||||
return (void *)(&server->password);
|
||||
if (strcasecmp (option_name, "server_nick1") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_nick1") == 0)
|
||||
return (void *)(&server->nick1);
|
||||
if (strcasecmp (option_name, "server_nick2") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_nick2") == 0)
|
||||
return (void *)(&server->nick2);
|
||||
if (strcasecmp (option_name, "server_nick3") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_nick3") == 0)
|
||||
return (void *)(&server->nick3);
|
||||
if (strcasecmp (option_name, "server_username") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_username") == 0)
|
||||
return (void *)(&server->username);
|
||||
if (strcasecmp (option_name, "server_realname") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_realname") == 0)
|
||||
return (void *)(&server->realname);
|
||||
if (strcasecmp (option_name, "server_command") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_command") == 0)
|
||||
return (void *)(&server->command);
|
||||
if (strcasecmp (option_name, "server_command_delay") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_command_delay") == 0)
|
||||
return (void *)(&server->command_delay);
|
||||
if (strcasecmp (option_name, "server_autojoin") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autojoin") == 0)
|
||||
return (void *)(&server->autojoin);
|
||||
if (strcasecmp (option_name, "server_autorejoin") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_autorejoin") == 0)
|
||||
return (void *)(&server->autorejoin);
|
||||
if (strcasecmp (option_name, "server_notify_levels") == 0)
|
||||
if (ascii_strcasecmp (option_name, "server_notify_levels") == 0)
|
||||
return (void *)(&server->notify_levels);
|
||||
/* option not found */
|
||||
return NULL;
|
||||
@@ -1031,7 +1031,7 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
|
||||
{
|
||||
/* if option found, return pointer */
|
||||
if (strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
|
||||
if (ascii_strcasecmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, option_name) == 0)
|
||||
{
|
||||
ptr_option = &weechat_options[CONFIG_SECTION_SERVER][i];
|
||||
break;
|
||||
@@ -1043,9 +1043,9 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
switch (ptr_option->option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
if (strcasecmp (value, "on") == 0)
|
||||
if (ascii_strcasecmp (value, "on") == 0)
|
||||
*((int *)(ptr_data)) = BOOL_TRUE;
|
||||
else if (strcasecmp (value, "off") == 0)
|
||||
else if (ascii_strcasecmp (value, "off") == 0)
|
||||
*((int *)(ptr_data)) = BOOL_FALSE;
|
||||
else
|
||||
return -2;
|
||||
@@ -1095,7 +1095,7 @@ config_option_search (char *option_name)
|
||||
for (j = 0; weechat_options[i][j].option_name; j++)
|
||||
{
|
||||
/* if option found, return pointer */
|
||||
if (strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
|
||||
if (ascii_strcasecmp (weechat_options[i][j].option_name, option_name) == 0)
|
||||
return &weechat_options[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ weelist_search (t_weelist *weelist, char *data)
|
||||
|
||||
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strcasecmp (data, ptr_weelist->data) == 0)
|
||||
if (ascii_strcasecmp (data, ptr_weelist->data) == 0)
|
||||
return ptr_weelist;
|
||||
}
|
||||
/* word not found in list */
|
||||
@@ -60,7 +60,7 @@ weelist_find_pos (t_weelist *weelist, char *data)
|
||||
|
||||
for (ptr_weelist = weelist; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
|
||||
{
|
||||
if (strcasecmp (data, ptr_weelist->data) < 0)
|
||||
if (ascii_strcasecmp (data, ptr_weelist->data) < 0)
|
||||
return ptr_weelist;
|
||||
}
|
||||
/* position not found, best position is at the end */
|
||||
|
||||
@@ -80,7 +80,7 @@ gui_assign_color (int *color, char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
{
|
||||
*color = gui_colors[i].color;
|
||||
return 1;
|
||||
@@ -105,7 +105,7 @@ gui_get_color_by_name (char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
return gui_colors[i].color;
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ gui_assign_color (int *color, char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
{
|
||||
*color = gui_colors[i].color;
|
||||
return 1;
|
||||
@@ -114,7 +114,7 @@ gui_get_color_by_name (char *color_name)
|
||||
i = 0;
|
||||
while (gui_colors[i].name)
|
||||
{
|
||||
if (strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
if (ascii_strcasecmp (gui_colors[i].name, color_name) == 0)
|
||||
return gui_colors[i].color;
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -157,17 +157,17 @@ gui_key_get_internal_code (char *key)
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "meta2-", 6) == 0)
|
||||
if (ascii_strncasecmp (key, "meta2-", 6) == 0)
|
||||
{
|
||||
strcat (result, "^[[");
|
||||
key += 6;
|
||||
}
|
||||
if (strncasecmp (key, "meta-", 5) == 0)
|
||||
if (ascii_strncasecmp (key, "meta-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^[");
|
||||
key += 5;
|
||||
}
|
||||
else if (strncasecmp (key, "ctrl-", 5) == 0)
|
||||
else if (ascii_strncasecmp (key, "ctrl-", 5) == 0)
|
||||
{
|
||||
strcat (result, "^");
|
||||
key += 5;
|
||||
@@ -200,12 +200,12 @@ gui_key_get_expanded_name (char *key)
|
||||
result[0] = '\0';
|
||||
while (key[0])
|
||||
{
|
||||
if (strncasecmp (key, "^[[", 3) == 0)
|
||||
if (ascii_strncasecmp (key, "^[[", 3) == 0)
|
||||
{
|
||||
strcat (result, "meta2-");
|
||||
key += 3;
|
||||
}
|
||||
if (strncasecmp (key, "^[", 2) == 0)
|
||||
if (ascii_strncasecmp (key, "^[", 2) == 0)
|
||||
{
|
||||
strcat (result, "meta-");
|
||||
key += 2;
|
||||
@@ -239,7 +239,7 @@ gui_key_find_pos (t_gui_key *key)
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (key->key, ptr_key->key) < 0)
|
||||
if (ascii_strcasecmp (key->key, ptr_key->key) < 0)
|
||||
return ptr_key;
|
||||
}
|
||||
return NULL;
|
||||
@@ -324,7 +324,7 @@ gui_key_search (char *key)
|
||||
|
||||
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, key) == 0)
|
||||
if (ascii_strcasecmp (ptr_key->key, key) == 0)
|
||||
return ptr_key;
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ gui_key_function_search_by_name (char *name)
|
||||
i = 0;
|
||||
while (gui_key_functions[i].function_name)
|
||||
{
|
||||
if (strcasecmp (gui_key_functions[i].function_name, name) == 0)
|
||||
if (ascii_strcasecmp (gui_key_functions[i].function_name, name) == 0)
|
||||
return gui_key_functions[i].function;
|
||||
i++;
|
||||
}
|
||||
@@ -504,7 +504,7 @@ gui_key_pressed (char *key_str)
|
||||
ptr_key = gui_key_search_part (gui_key_buffer);
|
||||
if (ptr_key)
|
||||
{
|
||||
if (strcasecmp (ptr_key->key, gui_key_buffer) == 0)
|
||||
if (ascii_strcasecmp (ptr_key->key, gui_key_buffer) == 0)
|
||||
{
|
||||
/* exact combo found => execute function or command */
|
||||
gui_key_buffer[0] = '\0';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -73,7 +73,7 @@ static XS (XS_IRC_register)
|
||||
for (ptr_perl_script = perl_scripts; ptr_perl_script;
|
||||
ptr_perl_script = ptr_perl_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
{
|
||||
perl_script_found = ptr_perl_script;
|
||||
break;
|
||||
@@ -182,12 +182,12 @@ static XS (XS_IRC_print_with_channel)
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (!server || (strcasecmp (ptr_server->name, server)) == 0)
|
||||
if (!server || (ascii_strcasecmp (ptr_server->name, server)) == 0)
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (strcasecmp (ptr_channel->name, channel) == 0)
|
||||
if (ascii_strcasecmp (ptr_channel->name, channel) == 0)
|
||||
{
|
||||
ptr_buffer = ptr_channel->buffer;
|
||||
break;
|
||||
@@ -260,7 +260,7 @@ static XS (XS_IRC_command)
|
||||
command = SvPV (ST (1), integer);
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
if (ascii_strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
@@ -383,30 +383,30 @@ static XS (XS_IRC_get_info)
|
||||
|
||||
if (arg)
|
||||
{
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) ) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) ) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
@@ -448,7 +448,7 @@ static XS (XS_weechat_register)
|
||||
for (ptr_perl_script = perl_scripts; ptr_perl_script;
|
||||
ptr_perl_script = ptr_perl_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_perl_script->name, name) == 0)
|
||||
{
|
||||
perl_script_found = ptr_perl_script;
|
||||
break;
|
||||
@@ -731,36 +731,36 @@ static XS (XS_weechat_get_info)
|
||||
arg = SvPV (ST (0), integer);
|
||||
if (arg)
|
||||
{
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) ) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) ) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( ptr_server && ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) ) )
|
||||
else if ( ptr_server && ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) ) )
|
||||
{
|
||||
XST_mIV (0, SERVER(gui_current_window->buffer)->is_away);
|
||||
XSRETURN (1);
|
||||
return;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "100") == 0) || (ascii_strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
int nItems = 0;
|
||||
t_irc_dcc *p = dcc_list;
|
||||
|
||||
@@ -181,7 +181,7 @@ plugin_handler_search (t_plugin_handler *plugin_handlers, char *name)
|
||||
ptr_plugin_handler = ptr_plugin_handler->next_handler)
|
||||
{
|
||||
/* handler found */
|
||||
if (strcasecmp (ptr_plugin_handler->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_plugin_handler->name, name) == 0)
|
||||
return ptr_plugin_handler;
|
||||
}
|
||||
/* handler not found */
|
||||
@@ -309,7 +309,7 @@ plugin_event_msg (char *irc_command, char *server, char *arguments)
|
||||
for (ptr_plugin_handler = plugin_msg_handlers; ptr_plugin_handler;
|
||||
ptr_plugin_handler = ptr_plugin_handler->next_handler)
|
||||
{
|
||||
if (strcasecmp (ptr_plugin_handler->name, irc_command) == 0)
|
||||
if (ascii_strcasecmp (ptr_plugin_handler->name, irc_command) == 0)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
@@ -367,7 +367,7 @@ plugin_exec_command (char *user_command, char *server, char *arguments)
|
||||
for (ptr_plugin_handler = plugin_cmd_handlers; ptr_plugin_handler;
|
||||
ptr_plugin_handler = ptr_plugin_handler->next_handler)
|
||||
{
|
||||
if (strcasecmp (ptr_plugin_handler->name, user_command) == 0)
|
||||
if (ascii_strcasecmp (ptr_plugin_handler->name, user_command) == 0)
|
||||
{
|
||||
#ifdef PLUGIN_PERL
|
||||
if (ptr_plugin_handler->plugin_type == PLUGIN_TYPE_PERL)
|
||||
|
||||
@@ -66,7 +66,7 @@ wee_python_register (PyObject *self, PyObject *args)
|
||||
for (ptr_python_script = python_scripts; ptr_python_script;
|
||||
ptr_python_script = ptr_python_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_python_script->name, name) == 0)
|
||||
if (ascii_strcasecmp (ptr_python_script->name, name) == 0)
|
||||
{
|
||||
python_script_found = ptr_python_script;
|
||||
break;
|
||||
@@ -321,7 +321,7 @@ wee_python_get_info (PyObject *self, PyObject *args)
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, server) == 0)
|
||||
if (ascii_strcasecmp (ptr_server->name, server) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
@@ -336,34 +336,34 @@ wee_python_get_info (PyObject *self, PyObject *args)
|
||||
|
||||
if (ptr_server && arg)
|
||||
{
|
||||
if ( (strcasecmp (arg, "0") == 0) || (strcasecmp (arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (arg, "0") == 0) || (ascii_strcasecmp (arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "1") == 0) || (strcasecmp (arg, "nick") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "1") == 0) || (ascii_strcasecmp (arg, "nick") == 0) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "2") == 0) || (strcasecmp (arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "2") == 0) || (ascii_strcasecmp (arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "3") == 0) || (strcasecmp (arg, "server") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "3") == 0) || (ascii_strcasecmp (arg, "server") == 0) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "4") == 0) || (strcasecmp (arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "4") == 0) || (ascii_strcasecmp (arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( (strcasecmp (arg, "5") == 0) || (strcasecmp (arg, "away") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "5") == 0) || (ascii_strcasecmp (arg, "away") == 0) )
|
||||
{
|
||||
return Py_BuildValue ("i", SERVER(gui_current_window->buffer)->is_away);
|
||||
}
|
||||
else if ( (strcasecmp (arg, "100") == 0) || (strcasecmp (arg, "dccs") == 0) )
|
||||
else if ( (ascii_strcasecmp (arg, "100") == 0) || (ascii_strcasecmp (arg, "dccs") == 0) )
|
||||
{
|
||||
t_irc_dcc *p = dcc_list;
|
||||
int nbdccs = 0;
|
||||
|
||||
@@ -74,7 +74,7 @@ wee_ruby_register (VALUE class, VALUE name, VALUE version, VALUE shutdown_func,
|
||||
for (ptr_ruby_script = ruby_scripts; ptr_ruby_script;
|
||||
ptr_ruby_script = ptr_ruby_script->next_script)
|
||||
{
|
||||
if (strcasecmp (ptr_ruby_script->name, c_name) == 0)
|
||||
if (ascii_strcasecmp (ptr_ruby_script->name, c_name) == 0)
|
||||
{
|
||||
ruby_script_found = ptr_ruby_script;
|
||||
break;
|
||||
@@ -357,7 +357,7 @@ wee_ruby_get_info (VALUE class, VALUE arg, VALUE server_name)
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (strcasecmp (ptr_server->name, c_server_name) == 0)
|
||||
if (ascii_strcasecmp (ptr_server->name, c_server_name) == 0)
|
||||
break;
|
||||
}
|
||||
if (!ptr_server)
|
||||
@@ -372,34 +372,34 @@ wee_ruby_get_info (VALUE class, VALUE arg, VALUE server_name)
|
||||
|
||||
if (ptr_server && c_arg)
|
||||
{
|
||||
if ( (strcasecmp (c_arg, "0") == 0) || (strcasecmp (c_arg, "version") == 0) )
|
||||
if ( (ascii_strcasecmp (c_arg, "0") == 0) || (ascii_strcasecmp (c_arg, "version") == 0) )
|
||||
{
|
||||
info = PACKAGE_STRING;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "1") == 0) || (strcasecmp (c_arg, "nick") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "1") == 0) || (ascii_strcasecmp (c_arg, "nick") == 0) )
|
||||
{
|
||||
if (ptr_server->nick)
|
||||
info = ptr_server->nick;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "2") == 0) || (strcasecmp (c_arg, "channel") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "2") == 0) || (ascii_strcasecmp (c_arg, "channel") == 0) )
|
||||
{
|
||||
if (BUFFER_IS_CHANNEL (gui_current_window->buffer))
|
||||
info = CHANNEL (gui_current_window->buffer)->name;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "3") == 0) || (strcasecmp (c_arg, "server") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "3") == 0) || (ascii_strcasecmp (c_arg, "server") == 0) )
|
||||
{
|
||||
if (ptr_server->name)
|
||||
info = ptr_server->name;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "4") == 0) || (strcasecmp (c_arg, "weechatdir") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "4") == 0) || (ascii_strcasecmp (c_arg, "weechatdir") == 0) )
|
||||
{
|
||||
info = weechat_home;
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "5") == 0) || (strcasecmp (c_arg, "away") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "5") == 0) || (ascii_strcasecmp (c_arg, "away") == 0) )
|
||||
{
|
||||
return INT2FIX (SERVER(gui_current_window->buffer)->is_away);
|
||||
}
|
||||
else if ( (strcasecmp (c_arg, "100") == 0) || (strcasecmp (c_arg, "dccs") == 0) )
|
||||
else if ( (ascii_strcasecmp (c_arg, "100") == 0) || (ascii_strcasecmp (c_arg, "dccs") == 0) )
|
||||
{
|
||||
/* TODO: build dcc list */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user