diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-19 11:18:49 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-19 11:18:49 +0100 |
commit | 33b6adc3d38ba44078728877a5851ce0e9b36450 (patch) | |
tree | bb33582300380a782791eabbfa6c9b1c50e73784 | |
parent | 56436e57fd29eb81b3e890e5142904958795f14c (diff) | |
download | weechat-33b6adc3d38ba44078728877a5851ce0e9b36450.zip |
core: fix call to string_toupper
-rw-r--r-- | src/core/wee-signal.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/wee-signal.c b/src/core/wee-signal.c index 9e1e29684..a9c51dcce 100644 --- a/src/core/wee-signal.c +++ b/src/core/wee-signal.c @@ -202,14 +202,14 @@ signal_send_to_weechat (int signal_index) void signal_exec_command (int signal_index, const char *command) { - char str_signal[32], **commands, **ptr_command, *command_eval; + char str_signal[32], *signal_upper, **commands, **ptr_command; + char *command_eval; if (!command || !command[0]) return; snprintf (str_signal, sizeof (str_signal), "sig%s", signal_list[signal_index].name); - string_toupper (str_signal); commands = string_split_command (command, ';'); if (commands) @@ -219,8 +219,12 @@ signal_exec_command (int signal_index, const char *command) command_eval = eval_expression (*ptr_command, NULL, NULL, NULL); if (command_eval) { + signal_upper = string_toupper (str_signal); log_printf ("Signal %s received, executing command: \"%s\"", - str_signal, command_eval); + (signal_upper) ? signal_upper : str_signal, + command_eval); + if (signal_upper) + free (signal_upper); (void) input_data (gui_buffer_search_main (), command_eval, NULL); free (command_eval); |