From 67838983adecd9b20ba862e85c8acd3bc04f3f11 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 18 Feb 2013 18:31:19 +0100 Subject: [PATCH] irc: fix display of malformed CTCP (without closing char) (bug #38347) --- ChangeLog | 3 ++- src/plugins/irc/irc-protocol.c | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11ea60dec..98da3ad5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.4.1-dev, 2013-02-17 +v0.4.1-dev, 2013-02-18 Version 0.4.1 (under dev!) @@ -23,6 +23,7 @@ Version 0.4.1 (under dev!) * aspell: add info "aspell_dict" (dictionaries used on a buffer) * aspell: optimization on spellers to improve speed (save state by buffer) * guile: fix compilation with guile 2.0 +* irc: fix display of malformed CTCP (without closing char) (bug #38347) * irc: unmask smart filtered join if nick speaks in channel some minutes after the join, new option irc.look.smart_filter_join_unmask (task #12405) * irc: fix memory leak in purge of hashtables with joins (it was done only for diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 8252830db..260aa74f2 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1084,8 +1084,7 @@ IRC_PROTOCOL_CALLBACK(notice) pos_args = (argv_eol[2][0] == ':') ? argv_eol[2] + 1 : argv_eol[2]; } - if (nick && (pos_args[0] == '\01') - && (pos_args[strlen (pos_args) - 1] == '\01')) + if (nick && (pos_args[0] == '\01')) { irc_ctcp_display_reply_from_nick (server, date, command, nick, pos_args); } @@ -1543,8 +1542,7 @@ IRC_PROTOCOL_CALLBACK(privmsg) irc_channel_join_smart_filtered_unmask (ptr_channel, nick); /* CTCP to channel */ - if ((pos_args[0] == '\01') - && (pos_args[strlen (pos_args) - 1] == '\01')) + if (pos_args[0] == '\01') { irc_ctcp_recv (server, date, command, ptr_channel, address, nick, NULL, pos_args, @@ -1612,8 +1610,7 @@ IRC_PROTOCOL_CALLBACK(privmsg) remote_nick = (nick_is_me) ? pos_target : nick; /* CTCP to user */ - if ((pos_args[0] == '\01') - && (pos_args[strlen (pos_args) - 1] == '\01')) + if (pos_args[0] == '\01') { irc_ctcp_recv (server, date, command, NULL, address, nick, remote_nick, pos_args,