From a6873b725f3edfe63b61d16b434e06008bce1989 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 28 Jun 2011 13:38:55 +0200 Subject: [PATCH] irc: fix bug with comma in irc color code: do not strip comma if it is not followed by a digit (bug #33662) --- ChangeLog | 2 ++ src/plugins/irc/irc-color.c | 15 ++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 794fb4f31..5ddb58111 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,8 @@ Version 0.3.6 (under dev!) hdata_get_string * api: fix bug with function config_set_desc_plugin (use immediately description for option when function is called) +* irc: fix bug with comma in irc color code: do not strip comma if it is not + followed by a digit (bug #33662) * irc: add prefix "#" for all channels on join (if no prefix given) * irc: switch to buffer on /join #channel if channel buffer already exists * irc: update host of nicks on manual /who diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 4d5b2eed7..a80de5735 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -140,20 +140,17 @@ irc_color_decode (const char *string, int keep_colors) ptr_string++; } } - if (ptr_string[0] == ',') + if ((ptr_string[0] == ',') && (isdigit (ptr_string[1]))) { + ptr_string++; + str_bg[0] = ptr_string[0]; + str_bg[1] = '\0'; ptr_string++; if (isdigit (ptr_string[0])) { - str_bg[0] = ptr_string[0]; - str_bg[1] = '\0'; + str_bg[1] = ptr_string[0]; + str_bg[2] = '\0'; ptr_string++; - if (isdigit (ptr_string[0])) - { - str_bg[1] = ptr_string[0]; - str_bg[2] = '\0'; - ptr_string++; - } } } if (keep_colors)