mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 21:36:37 +02:00
core, plugins: make commands, hook command_run, completions and aliases case sensitive (issue #1872)
This commit is contained in:
@@ -1294,7 +1294,7 @@ script_action_run_all ()
|
||||
&argc);
|
||||
if (argv && argv_eol)
|
||||
{
|
||||
if (weechat_strcasecmp (argv[0], "buffer") == 0)
|
||||
if (weechat_strcmp (argv[0], "buffer") == 0)
|
||||
{
|
||||
/* open buffer with list of scripts */
|
||||
if (!script_buffer)
|
||||
@@ -1304,17 +1304,17 @@ script_action_run_all ()
|
||||
}
|
||||
weechat_buffer_set (script_buffer, "display", "1");
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "list") == 0)
|
||||
else if (weechat_strcmp (argv[0], "list") == 0)
|
||||
{
|
||||
if (argc > 1)
|
||||
{
|
||||
if (weechat_strcasecmp (argv[1], "-i") == 0)
|
||||
if (weechat_strcmp (argv[1], "-i") == 0)
|
||||
script_action_run_list_input (0, 0);
|
||||
else if (weechat_strcasecmp (argv[1], "-il") == 0)
|
||||
else if (weechat_strcmp (argv[1], "-il") == 0)
|
||||
script_action_run_list_input (0, 1);
|
||||
else if (weechat_strcasecmp (argv[1], "-o") == 0)
|
||||
else if (weechat_strcmp (argv[1], "-o") == 0)
|
||||
script_action_run_list_input (1, 0);
|
||||
else if (weechat_strcasecmp (argv[1], "-ol") == 0)
|
||||
else if (weechat_strcmp (argv[1], "-ol") == 0)
|
||||
script_action_run_list_input (1, 1);
|
||||
else
|
||||
script_action_run_list ();
|
||||
@@ -1322,49 +1322,49 @@ script_action_run_all ()
|
||||
else
|
||||
script_action_run_list ();
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "load") == 0)
|
||||
else if (weechat_strcmp (argv[0], "load") == 0)
|
||||
{
|
||||
for (j = 1; j < argc; j++)
|
||||
{
|
||||
script_action_run_load (argv[j], quiet);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "unload") == 0)
|
||||
else if (weechat_strcmp (argv[0], "unload") == 0)
|
||||
{
|
||||
for (j = 1; j < argc; j++)
|
||||
{
|
||||
script_action_run_unload (argv[j], quiet);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "reload") == 0)
|
||||
else if (weechat_strcmp (argv[0], "reload") == 0)
|
||||
{
|
||||
for (j = 1; j < argc; j++)
|
||||
{
|
||||
script_action_run_reload (argv[j], quiet);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "autoload") == 0)
|
||||
else if (weechat_strcmp (argv[0], "autoload") == 0)
|
||||
{
|
||||
for (j = 1; j < argc; j++)
|
||||
{
|
||||
script_action_run_autoload (argv[j], quiet, 1);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "noautoload") == 0)
|
||||
else if (weechat_strcmp (argv[0], "noautoload") == 0)
|
||||
{
|
||||
for (j = 1; j < argc; j++)
|
||||
{
|
||||
script_action_run_autoload (argv[j], quiet, 0);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "toggleautoload") == 0)
|
||||
else if (weechat_strcmp (argv[0], "toggleautoload") == 0)
|
||||
{
|
||||
for (j = 1; j < argc; j++)
|
||||
{
|
||||
script_action_run_autoload (argv[j], quiet, -1);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "install") == 0)
|
||||
else if (weechat_strcmp (argv[0], "install") == 0)
|
||||
{
|
||||
script_found = 0;
|
||||
for (j = 1; j < argc; j++)
|
||||
@@ -1402,14 +1402,14 @@ script_action_run_all ()
|
||||
if (script_found)
|
||||
script_action_run_install (quiet);
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "remove") == 0)
|
||||
else if (weechat_strcmp (argv[0], "remove") == 0)
|
||||
{
|
||||
for (j = 1; j < argc; j++)
|
||||
{
|
||||
script_action_run_remove (argv[j], quiet);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "installremove") == 0)
|
||||
else if (weechat_strcmp (argv[0], "installremove") == 0)
|
||||
{
|
||||
script_found = 0;
|
||||
for (j = 1; j < argc; j++)
|
||||
@@ -1443,7 +1443,7 @@ script_action_run_all ()
|
||||
if (script_found)
|
||||
script_action_run_install (quiet);
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "hold") == 0)
|
||||
else if (weechat_strcmp (argv[0], "hold") == 0)
|
||||
{
|
||||
script_found = 0;
|
||||
for (j = 1; j < argc; j++)
|
||||
@@ -1454,7 +1454,7 @@ script_action_run_all ()
|
||||
if (script_found)
|
||||
script_buffer_refresh (0);
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "show") == 0)
|
||||
else if (weechat_strcmp (argv[0], "show") == 0)
|
||||
{
|
||||
if (!script_buffer)
|
||||
script_buffer_open ();
|
||||
@@ -1462,11 +1462,11 @@ script_action_run_all ()
|
||||
quiet);
|
||||
weechat_buffer_set (script_buffer, "display", "1");
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "showdiff") == 0)
|
||||
else if (weechat_strcmp (argv[0], "showdiff") == 0)
|
||||
{
|
||||
script_action_run_showdiff ();
|
||||
}
|
||||
else if (weechat_strcasecmp (argv[0], "upgrade") == 0)
|
||||
else if (weechat_strcmp (argv[0], "upgrade") == 0)
|
||||
{
|
||||
script_found = 0;
|
||||
for (ptr_script = scripts_repo; ptr_script;
|
||||
|
||||
@@ -91,8 +91,8 @@ script_command_action (struct t_gui_buffer *buffer,
|
||||
{
|
||||
/* action on current line of script buffer */
|
||||
if (script_buffer_detail_script
|
||||
&& ((weechat_strcasecmp (action, "show") == 0)
|
||||
|| (weechat_strcasecmp (action, "showdiff") == 0)))
|
||||
&& ((weechat_strcmp (action, "show") == 0)
|
||||
|| (weechat_strcmp (action, "showdiff") == 0)))
|
||||
{
|
||||
/* if detail on script is displayed, back to list */
|
||||
snprintf (str_action, sizeof (str_action),
|
||||
@@ -144,7 +144,7 @@ script_command_script (const void *pointer, void *data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "go") == 0)
|
||||
if (weechat_strcmp (argv[1], "go") == 0)
|
||||
{
|
||||
if ((argc > 2) && script_buffer && !script_buffer_detail_script)
|
||||
{
|
||||
@@ -158,7 +158,7 @@ script_command_script (const void *pointer, void *data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "search") == 0)
|
||||
if (weechat_strcmp (argv[1], "search") == 0)
|
||||
{
|
||||
if (scripts_repo)
|
||||
script_repo_filter_scripts ((argc > 2) ? argv_eol[2] : NULL);
|
||||
@@ -168,18 +168,18 @@ script_command_script (const void *pointer, void *data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "list") == 0)
|
||||
if (weechat_strcmp (argv[1], "list") == 0)
|
||||
{
|
||||
script_action_schedule (argv_eol[1], 1, 0, 0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if ((weechat_strcasecmp (argv[1], "load") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "unload") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "reload") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "autoload") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "noautoload") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "toggleautoload") == 0))
|
||||
if ((weechat_strcmp (argv[1], "load") == 0)
|
||||
|| (weechat_strcmp (argv[1], "unload") == 0)
|
||||
|| (weechat_strcmp (argv[1], "reload") == 0)
|
||||
|| (weechat_strcmp (argv[1], "autoload") == 0)
|
||||
|| (weechat_strcmp (argv[1], "noautoload") == 0)
|
||||
|| (weechat_strcmp (argv[1], "toggleautoload") == 0))
|
||||
{
|
||||
script_command_action (buffer,
|
||||
argv[1],
|
||||
@@ -189,12 +189,12 @@ script_command_script (const void *pointer, void *data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if ((weechat_strcasecmp (argv[1], "install") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "remove") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "installremove") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "hold") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "show") == 0)
|
||||
|| (weechat_strcasecmp (argv[1], "showdiff") == 0))
|
||||
if ((weechat_strcmp (argv[1], "install") == 0)
|
||||
|| (weechat_strcmp (argv[1], "remove") == 0)
|
||||
|| (weechat_strcmp (argv[1], "installremove") == 0)
|
||||
|| (weechat_strcmp (argv[1], "hold") == 0)
|
||||
|| (weechat_strcmp (argv[1], "show") == 0)
|
||||
|| (weechat_strcmp (argv[1], "showdiff") == 0))
|
||||
{
|
||||
script_command_action (buffer,
|
||||
argv[1],
|
||||
@@ -204,19 +204,19 @@ script_command_script (const void *pointer, void *data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "upgrade") == 0)
|
||||
if (weechat_strcmp (argv[1], "upgrade") == 0)
|
||||
{
|
||||
script_action_schedule ("upgrade", 1, 1, 0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "update") == 0)
|
||||
if (weechat_strcmp (argv[1], "update") == 0)
|
||||
{
|
||||
script_repo_file_update (0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "up") == 0)
|
||||
if (weechat_strcmp (argv[1], "up") == 0)
|
||||
{
|
||||
if (script_buffer)
|
||||
{
|
||||
@@ -250,7 +250,7 @@ script_command_script (const void *pointer, void *data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "down") == 0)
|
||||
if (weechat_strcmp (argv[1], "down") == 0)
|
||||
{
|
||||
if (script_buffer)
|
||||
{
|
||||
|
||||
@@ -244,7 +244,7 @@ script_debug_dump_cb (const void *pointer, void *data,
|
||||
(void) type_data;
|
||||
|
||||
if (!signal_data
|
||||
|| (weechat_strcasecmp ((char *)signal_data, SCRIPT_PLUGIN_NAME) == 0))
|
||||
|| (weechat_strcmp ((char *)signal_data, SCRIPT_PLUGIN_NAME) == 0))
|
||||
{
|
||||
weechat_log_printf ("");
|
||||
weechat_log_printf ("***** \"%s\" plugin dump *****",
|
||||
|
||||
Reference in New Issue
Block a user