diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-01-15 10:54:56 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-01-28 15:13:48 +0100 |
commit | f0415c8ec3c6def45e5e61756e9a521f25e5f8a3 (patch) | |
tree | c8af8e4bd05cbaa2e13d7c671668662954fa342c /src/plugins/exec | |
parent | 1de735b7791f9bfd5f0f9f52bd809130558b74b0 (diff) | |
download | weechat-f0415c8ec3c6def45e5e61756e9a521f25e5f8a3.zip |
core, plugins: make commands, hook command_run, completions and aliases case sensitive (issue #1872)
Diffstat (limited to 'src/plugins/exec')
-rw-r--r-- | src/plugins/exec/exec-command.c | 74 | ||||
-rw-r--r-- | src/plugins/exec/exec.c | 4 |
2 files changed, 39 insertions, 39 deletions
diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c index 2e6289cb8..7cfec192a 100644 --- a/src/plugins/exec/exec-command.c +++ b/src/plugins/exec/exec-command.c @@ -186,31 +186,31 @@ exec_command_parse_options (struct t_exec_cmd_options *cmd_options, for (i = start_arg; i < argc; i++) { - if (weechat_strcasecmp (argv[i], "-sh") == 0) + if (weechat_strcmp (argv[i], "-sh") == 0) { cmd_options->use_shell = 1; } - else if (weechat_strcasecmp (argv[i], "-nosh") == 0) + else if (weechat_strcmp (argv[i], "-nosh") == 0) { cmd_options->use_shell = 0; } - else if (weechat_strcasecmp (argv[i], "-bg") == 0) + else if (weechat_strcmp (argv[i], "-bg") == 0) { cmd_options->detached = 1; } - else if (weechat_strcasecmp (argv[i], "-nobg") == 0) + else if (weechat_strcmp (argv[i], "-nobg") == 0) { cmd_options->detached = 0; } - else if (weechat_strcasecmp (argv[i], "-stdin") == 0) + else if (weechat_strcmp (argv[i], "-stdin") == 0) { cmd_options->pipe_stdin = 1; } - else if (weechat_strcasecmp (argv[i], "-nostdin") == 0) + else if (weechat_strcmp (argv[i], "-nostdin") == 0) { cmd_options->pipe_stdin = 0; } - else if (weechat_strcasecmp (argv[i], "-buffer") == 0) + else if (weechat_strcmp (argv[i], "-buffer") == 0) { if (i + 1 >= argc) return 0; @@ -226,73 +226,73 @@ exec_command_parse_options (struct t_exec_cmd_options *cmd_options, if (!cmd_options->ptr_buffer) cmd_options->new_buffer = 1; } - else if (weechat_strcasecmp (argv[i], "-l") == 0) + else if (weechat_strcmp (argv[i], "-l") == 0) { cmd_options->output_to_buffer = 0; cmd_options->output_to_buffer_exec_cmd = 0; cmd_options->new_buffer = 0; } - else if (weechat_strcasecmp (argv[i], "-o") == 0) + else if (weechat_strcmp (argv[i], "-o") == 0) { cmd_options->output_to_buffer = 1; cmd_options->output_to_buffer_exec_cmd = 0; cmd_options->new_buffer = 0; } - else if (weechat_strcasecmp (argv[i], "-oc") == 0) + else if (weechat_strcmp (argv[i], "-oc") == 0) { cmd_options->output_to_buffer = 1; cmd_options->output_to_buffer_exec_cmd = 1; cmd_options->new_buffer = 0; } - else if (weechat_strcasecmp (argv[i], "-oerr") == 0) + else if (weechat_strcmp (argv[i], "-oerr") == 0) { cmd_options->output_to_buffer_stderr = 1; } - else if (weechat_strcasecmp (argv[i], "-n") == 0) + else if (weechat_strcmp (argv[i], "-n") == 0) { cmd_options->output_to_buffer = 0; cmd_options->output_to_buffer_exec_cmd = 0; cmd_options->new_buffer = 1; } - else if (weechat_strcasecmp (argv[i], "-nf") == 0) + else if (weechat_strcmp (argv[i], "-nf") == 0) { cmd_options->output_to_buffer = 0; cmd_options->output_to_buffer_exec_cmd = 0; cmd_options->new_buffer = 2; } - else if (weechat_strcasecmp (argv[i], "-cl") == 0) + else if (weechat_strcmp (argv[i], "-cl") == 0) { cmd_options->new_buffer_clear = 1; } - else if (weechat_strcasecmp (argv[i], "-nocl") == 0) + else if (weechat_strcmp (argv[i], "-nocl") == 0) { cmd_options->new_buffer_clear = 0; } - else if (weechat_strcasecmp (argv[i], "-sw") == 0) + else if (weechat_strcmp (argv[i], "-sw") == 0) { cmd_options->switch_to_buffer = 1; } - else if (weechat_strcasecmp (argv[i], "-nosw") == 0) + else if (weechat_strcmp (argv[i], "-nosw") == 0) { cmd_options->switch_to_buffer = 0; } - else if (weechat_strcasecmp (argv[i], "-ln") == 0) + else if (weechat_strcmp (argv[i], "-ln") == 0) { cmd_options->line_numbers = 1; } - else if (weechat_strcasecmp (argv[i], "-noln") == 0) + else if (weechat_strcmp (argv[i], "-noln") == 0) { cmd_options->line_numbers = 0; } - else if (weechat_strcasecmp (argv[i], "-flush") == 0) + else if (weechat_strcmp (argv[i], "-flush") == 0) { cmd_options->flush = 1; } - else if (weechat_strcasecmp (argv[i], "-noflush") == 0) + else if (weechat_strcmp (argv[i], "-noflush") == 0) { cmd_options->flush = 0; } - else if (weechat_strcasecmp (argv[i], "-color") == 0) + else if (weechat_strcmp (argv[i], "-color") == 0) { if (i + 1 >= argc) return 0; @@ -301,15 +301,15 @@ exec_command_parse_options (struct t_exec_cmd_options *cmd_options, if (cmd_options->color < 0) return 0; } - else if (weechat_strcasecmp (argv[i], "-rc") == 0) + else if (weechat_strcmp (argv[i], "-rc") == 0) { cmd_options->display_rc = 1; } - else if (weechat_strcasecmp (argv[i], "-norc") == 0) + else if (weechat_strcmp (argv[i], "-norc") == 0) { cmd_options->display_rc = 0; } - else if (weechat_strcasecmp (argv[i], "-timeout") == 0) + else if (weechat_strcmp (argv[i], "-timeout") == 0) { if (i + 1 >= argc) return 0; @@ -319,14 +319,14 @@ exec_command_parse_options (struct t_exec_cmd_options *cmd_options, if (!error || error[0]) return 0; } - else if (weechat_strcasecmp (argv[i], "-name") == 0) + else if (weechat_strcmp (argv[i], "-name") == 0) { if (i + 1 >= argc) return 0; i++; cmd_options->ptr_command_name = argv[i]; } - else if (weechat_strcasecmp (argv[i], "-pipe") == 0) + else if (weechat_strcmp (argv[i], "-pipe") == 0) { if (i + 1 >= argc) return 0; @@ -370,7 +370,7 @@ exec_command_parse_options (struct t_exec_cmd_options *cmd_options, else cmd_options->pipe_command = strdup (argv[i]); } - else if (weechat_strcasecmp (argv[i], "-hsignal") == 0) + else if (weechat_strcmp (argv[i], "-hsignal") == 0) { if (i + 1 >= argc) return 0; @@ -676,14 +676,14 @@ exec_command_exec (const void *pointer, void *data, /* list running commands */ if ((argc == 1) - || ((argc == 2) && (weechat_strcasecmp (argv[1], "-list") == 0))) + || ((argc == 2) && (weechat_strcmp (argv[1], "-list") == 0))) { exec_command_list (); return WEECHAT_RC_OK; } /* send text to a running process */ - if (weechat_strcasecmp (argv[1], "-in") == 0) + if (weechat_strcmp (argv[1], "-in") == 0) { WEECHAT_COMMAND_MIN_ARGS(4, "-in"); ptr_exec_cmd = exec_command_search_running_id (argv[2]); @@ -702,7 +702,7 @@ exec_command_exec (const void *pointer, void *data, } /* send text to a running process (if given), then close stdin */ - if (weechat_strcasecmp (argv[1], "-inclose") == 0) + if (weechat_strcmp (argv[1], "-inclose") == 0) { WEECHAT_COMMAND_MIN_ARGS(3, "-inclose"); ptr_exec_cmd = exec_command_search_running_id (argv[2]); @@ -725,7 +725,7 @@ exec_command_exec (const void *pointer, void *data, } /* send a signal to a running process */ - if (weechat_strcasecmp (argv[1], "-signal") == 0) + if (weechat_strcmp (argv[1], "-signal") == 0) { WEECHAT_COMMAND_MIN_ARGS(4, "-signal"); ptr_exec_cmd = exec_command_search_running_id (argv[2]); @@ -735,7 +735,7 @@ exec_command_exec (const void *pointer, void *data, } /* send a KILL signal to a running process */ - if (weechat_strcasecmp (argv[1], "-kill") == 0) + if (weechat_strcmp (argv[1], "-kill") == 0) { WEECHAT_COMMAND_MIN_ARGS(3, "-kill"); ptr_exec_cmd = exec_command_search_running_id (argv[2]); @@ -745,7 +745,7 @@ exec_command_exec (const void *pointer, void *data, } /* send a KILL signal to all running processes */ - if (weechat_strcasecmp (argv[1], "-killall") == 0) + if (weechat_strcmp (argv[1], "-killall") == 0) { for (ptr_exec_cmd = exec_cmds; ptr_exec_cmd; ptr_exec_cmd = ptr_exec_cmd->next_cmd) @@ -759,7 +759,7 @@ exec_command_exec (const void *pointer, void *data, } /* set a hook property */ - if (weechat_strcasecmp (argv[1], "-set") == 0) + if (weechat_strcmp (argv[1], "-set") == 0) { WEECHAT_COMMAND_MIN_ARGS(5, "-set"); ptr_exec_cmd = exec_command_search_running_id (argv[2]); @@ -769,10 +769,10 @@ exec_command_exec (const void *pointer, void *data, } /* delete terminated command(s) */ - if (weechat_strcasecmp (argv[1], "-del") == 0) + if (weechat_strcmp (argv[1], "-del") == 0) { WEECHAT_COMMAND_MIN_ARGS(3, "-del"); - if (weechat_strcasecmp (argv[2], "-all") == 0) + if (weechat_strcmp (argv[2], "-all") == 0) { count = 0; ptr_exec_cmd = exec_cmds; diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c index da404a080..71447a76b 100644 --- a/src/plugins/exec/exec.c +++ b/src/plugins/exec/exec.c @@ -65,7 +65,7 @@ exec_search_color (const char *color) for (i = 0; i < EXEC_NUM_COLORS; i++) { - if (weechat_strcasecmp (exec_color_string[i], color) == 0) + if (weechat_strcmp (exec_color_string[i], color) == 0) return i; } @@ -724,7 +724,7 @@ exec_debug_dump_cb (const void *pointer, void *data, (void) type_data; if (!signal_data - || (weechat_strcasecmp ((char *)signal_data, EXEC_PLUGIN_NAME) == 0)) + || (weechat_strcmp ((char *)signal_data, EXEC_PLUGIN_NAME) == 0)) { weechat_log_printf (""); weechat_log_printf ("***** \"%s\" plugin dump *****", |