1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 11:43:13 +02:00

irc: fix unexpected message sent to server when part of the second line of an IRC command (closes #1992)

This commit is contained in:
Sébastien Helleu
2023-09-12 08:14:23 +02:00
parent 8eb2604704
commit c4c58e0914
6 changed files with 56 additions and 15 deletions
+16 -2
View File
@@ -3174,8 +3174,8 @@ struct t_arraylist *
irc_server_sendf (struct t_irc_server *server, int flags, const char *tags,
const char *format, ...)
{
char hash_key[32], *nick, *command, *channel, *new_msg;
char str_modifier[128];
char hash_key[32], *nick, *command, *channel, *new_msg, str_modifier[128];
char *pos;
const char *str_message, *str_args, *ptr_msg;
int number, multiline;
struct t_hashtable *hashtable;
@@ -3200,6 +3200,20 @@ irc_server_sendf (struct t_irc_server *server, int flags, const char *tags,
list_messages = NULL;
}
if (!(flags & IRC_SERVER_SEND_MULTILINE))
{
/*
* if multiline is not allowed, we stop at first \r or \n in the
* message, and everything after is ignored
*/
pos = strchr (vbuffer, '\r');
if (pos)
pos[0] = '\0';
pos = strchr (vbuffer, '\n');
if (pos)
pos[0] = '\0';
}
/* run modifier "irc_out1_xxx" (like "irc_out_xxx", but before split) */
irc_message_parse (server,
vbuffer,