mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 14:56:39 +02:00
irc: fix calls to weechat_string_toupper
This commit is contained in:
@@ -813,7 +813,7 @@ IRC_COMMAND_CALLBACK(allserv)
|
||||
|
||||
IRC_COMMAND_CALLBACK(auth)
|
||||
{
|
||||
char str_msg_auth[512];
|
||||
char str_msg_auth[512], *str_msg_auth_upper;
|
||||
int sasl_mechanism;
|
||||
|
||||
IRC_BUFFER_GET_SERVER(buffer);
|
||||
@@ -861,9 +861,14 @@ IRC_COMMAND_CALLBACK(auth)
|
||||
snprintf (str_msg_auth, sizeof (str_msg_auth),
|
||||
"AUTHENTICATE %s",
|
||||
irc_sasl_mechanism_string[sasl_mechanism]);
|
||||
weechat_string_toupper (str_msg_auth);
|
||||
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
str_msg_auth);
|
||||
str_msg_auth_upper = weechat_string_toupper (str_msg_auth);
|
||||
if (str_msg_auth_upper)
|
||||
{
|
||||
irc_server_sendf (ptr_server,
|
||||
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
str_msg_auth_upper);
|
||||
free (str_msg_auth_upper);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1505,12 +1510,10 @@ IRC_COMMAND_CALLBACK(cap)
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
cap_cmd = strdup (argv[1]);
|
||||
cap_cmd = weechat_string_toupper (argv[1]);
|
||||
if (!cap_cmd)
|
||||
WEECHAT_COMMAND_ERROR;
|
||||
|
||||
weechat_string_toupper (cap_cmd);
|
||||
|
||||
if ((strcmp (cap_cmd, "LS") == 0) && !argv_eol[2])
|
||||
{
|
||||
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
|
||||
@@ -1829,15 +1832,13 @@ IRC_COMMAND_CALLBACK(ctcp)
|
||||
if (!targets)
|
||||
WEECHAT_COMMAND_ERROR;
|
||||
|
||||
ctcp_type = strdup (argv[arg_type]);
|
||||
ctcp_type = weechat_string_toupper (argv[arg_type]);
|
||||
if (!ctcp_type)
|
||||
{
|
||||
weechat_string_free_split (targets);
|
||||
WEECHAT_COMMAND_ERROR;
|
||||
}
|
||||
|
||||
weechat_string_toupper (ctcp_type);
|
||||
|
||||
if ((strcmp (ctcp_type, "PING") == 0) && !argv_eol[arg_args])
|
||||
{
|
||||
/* generate argument for PING if not provided */
|
||||
|
||||
@@ -270,10 +270,11 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
|
||||
{
|
||||
struct t_hashtable *hashtable;
|
||||
int number;
|
||||
char hash_key[32], *str_args_color, *dup_ctcp, *dup_args;
|
||||
char hash_key[32], *str_args_color, *dup_ctcp, *dup_ctcp_upper, *dup_args;
|
||||
const char *str_args;
|
||||
|
||||
dup_ctcp = NULL;
|
||||
dup_ctcp_upper = NULL;
|
||||
dup_args = NULL;
|
||||
hashtable = NULL;
|
||||
|
||||
@@ -284,7 +285,10 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
|
||||
dup_ctcp = weechat_string_replace (ctcp, "\01", " ");
|
||||
if (!dup_ctcp)
|
||||
goto end;
|
||||
weechat_string_toupper (dup_ctcp);
|
||||
|
||||
dup_ctcp_upper = weechat_string_toupper (dup_ctcp);
|
||||
if (!dup_ctcp_upper)
|
||||
goto end;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
@@ -303,7 +307,7 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
|
||||
NULL,
|
||||
"NOTICE %s :\01%s%s%s\01",
|
||||
nick,
|
||||
dup_ctcp,
|
||||
dup_ctcp_upper,
|
||||
(dup_args) ? " " : "",
|
||||
(dup_args) ? dup_args : "");
|
||||
if (!hashtable)
|
||||
@@ -338,7 +342,7 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
|
||||
nick,
|
||||
IRC_COLOR_RESET,
|
||||
IRC_COLOR_CHAT_CHANNEL,
|
||||
dup_ctcp,
|
||||
dup_ctcp_upper,
|
||||
(str_args_color[0]) ? IRC_COLOR_RESET : "",
|
||||
(str_args_color[0]) ? " " : "",
|
||||
str_args_color);
|
||||
@@ -350,6 +354,8 @@ irc_ctcp_reply_to_nick (struct t_irc_server *server,
|
||||
end:
|
||||
if (dup_ctcp)
|
||||
free (dup_ctcp);
|
||||
if (dup_ctcp_upper)
|
||||
free (dup_ctcp_upper);
|
||||
if (dup_args)
|
||||
free (dup_args);
|
||||
if (hashtable)
|
||||
|
||||
@@ -842,7 +842,8 @@ IRC_PROTOCOL_CALLBACK(cap)
|
||||
{
|
||||
char **caps_supported, **caps_added, **caps_removed;
|
||||
char **caps_enabled, *pos_value, *str_name, **str_caps;
|
||||
char str_msg_auth[512], **str_caps_enabled, **str_caps_disabled, *str_params;
|
||||
char str_msg_auth[512], *str_msg_auth_upper, **str_caps_enabled;
|
||||
char **str_caps_disabled, *str_params;
|
||||
int arg_caps, num_caps_supported, num_caps_added, num_caps_removed;
|
||||
int num_caps_enabled, sasl_to_do, sasl_mechanism;
|
||||
int i, j, timeout, last_reply;
|
||||
@@ -1094,8 +1095,12 @@ IRC_PROTOCOL_CALLBACK(cap)
|
||||
snprintf (str_msg_auth, sizeof (str_msg_auth),
|
||||
"AUTHENTICATE %s",
|
||||
irc_sasl_mechanism_string[sasl_mechanism]);
|
||||
weechat_string_toupper (str_msg_auth);
|
||||
irc_server_sendf (server, 0, NULL, str_msg_auth);
|
||||
str_msg_auth_upper = weechat_string_toupper (str_msg_auth);
|
||||
if (str_msg_auth_upper)
|
||||
{
|
||||
irc_server_sendf (server, 0, NULL, str_msg_auth_upper);
|
||||
free (str_msg_auth_upper);
|
||||
}
|
||||
if (server->hook_timer_sasl)
|
||||
weechat_unhook (server->hook_timer_sasl);
|
||||
timeout = IRC_SERVER_OPTION_INTEGER(
|
||||
|
||||
@@ -406,7 +406,7 @@ irc_redirect_new_with_commands (struct t_irc_server *server,
|
||||
const char *cmd_filter)
|
||||
{
|
||||
struct t_irc_redirect *new_redirect;
|
||||
char **items[4], *pos, *error;
|
||||
char **items[4], *item_upper, *pos, *error;
|
||||
int i, j, num_items[4];
|
||||
long value;
|
||||
struct t_hashtable *hash_cmd[4];
|
||||
@@ -466,8 +466,12 @@ irc_redirect_new_with_commands (struct t_irc_server *server,
|
||||
if (!error || error[0])
|
||||
value = -1;
|
||||
}
|
||||
weechat_string_toupper (items[i][j]);
|
||||
weechat_hashtable_set (hash_cmd[i], items[i][j], &value);
|
||||
item_upper = weechat_string_toupper (items[i][j]);
|
||||
if (item_upper)
|
||||
{
|
||||
weechat_hashtable_set (hash_cmd[i], item_upper, &value);
|
||||
free (item_upper);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user