Fix bug with charset decoding (for example with iso2022jp)
This commit is contained in:
parent
b01bc3eb21
commit
50a62179d4
@ -855,7 +855,6 @@ void
|
||||
irc_server_msgq_add_msg (t_irc_server *server, char *msg)
|
||||
{
|
||||
t_irc_message *message;
|
||||
char *ptr_data;
|
||||
|
||||
if (!server->unterminated_message && !msg[0])
|
||||
return;
|
||||
@ -893,21 +892,6 @@ irc_server_msgq_add_msg (t_irc_server *server, char *msg)
|
||||
message->data = strdup (msg);
|
||||
message->next_message = NULL;
|
||||
|
||||
/* remove any WeeChat color code in message
|
||||
(must not be in received message!) */
|
||||
ptr_data = message->data;
|
||||
while (ptr_data && ptr_data[0])
|
||||
{
|
||||
if ((ptr_data[0] == GUI_ATTR_WEECHAT_COLOR_CHAR)
|
||||
|| (ptr_data[0] == GUI_ATTR_WEECHAT_SET_CHAR)
|
||||
|| (ptr_data[0] == GUI_ATTR_WEECHAT_REMOVE_CHAR)
|
||||
|| (ptr_data[0] == GUI_ATTR_WEECHAT_RESET_CHAR))
|
||||
{
|
||||
ptr_data[0] = '?';
|
||||
}
|
||||
ptr_data++;
|
||||
}
|
||||
|
||||
if (irc_msgq_last_msg)
|
||||
{
|
||||
irc_msgq_last_msg->next_message = message;
|
||||
@ -1005,7 +989,7 @@ void
|
||||
irc_server_msgq_flush ()
|
||||
{
|
||||
t_irc_message *next;
|
||||
char *ptr_data, *new_msg, *ptr_msg, *pos;
|
||||
char *ptr_data, *new_msg, *ptr_msg, *pos, *pos2;
|
||||
char *host, *command, *args;
|
||||
|
||||
while (irc_recv_msgq)
|
||||
@ -1050,7 +1034,22 @@ irc_server_msgq_flush ()
|
||||
pos = strchr (ptr_msg, '\n');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
|
||||
|
||||
/* remove any WeeChat color code in message
|
||||
(must not be in received message!) */
|
||||
pos2 = ptr_msg;
|
||||
while (pos2[0])
|
||||
{
|
||||
if ((pos2[0] == GUI_ATTR_WEECHAT_COLOR_CHAR)
|
||||
|| (pos2[0] == GUI_ATTR_WEECHAT_SET_CHAR)
|
||||
|| (pos2[0] == GUI_ATTR_WEECHAT_REMOVE_CHAR)
|
||||
|| (pos2[0] == GUI_ATTR_WEECHAT_RESET_CHAR))
|
||||
{
|
||||
pos2[0] = '?';
|
||||
}
|
||||
pos2++;
|
||||
}
|
||||
|
||||
if (new_msg)
|
||||
gui_printf_raw_data (irc_recv_msgq->server, 0, 1, ptr_msg);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user