From 2e20ec0ef6a87342a02d90aa73d8daadf478fa0b Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sat, 4 Jul 2015 00:24:34 +0200 Subject: degesch: get real with the CTCP --- common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common.c b/common.c index 7b845d8..951055c 100644 --- a/common.c +++ b/common.c @@ -924,7 +924,7 @@ ctcp_parse (const char *message) if (my_is_ctcp) ctcp_parse_tagged (m.str + my_start, i - my_start, chunk); else - ctcp_intra_decode (m.str + my_start, i - my_start, &chunk->text); + str_append_data (&chunk->text, m.str + my_start, i - my_start); LIST_APPEND_WITH_TAIL (result, result_tail, chunk); } @@ -933,7 +933,10 @@ ctcp_parse (const char *message) if (!in_ctcp && start != m.len) { struct ctcp_chunk *chunk = ctcp_chunk_new (); - ctcp_intra_decode (m.str + start, m.len - start, &chunk->text); + // According to the original CTCP specification we should use + // ctcp_intra_decode() but no one seems to use that and it breaks + // normal text with backslashes + str_append_data (&chunk->text, m.str + start, m.len - start); LIST_APPEND_WITH_TAIL (result, result_tail, chunk); } -- cgit v1.2.3-70-g09d2