1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 17:53:13 +02:00

irc: fix bug with comma in irc color code: do not strip comma if it is not followed by a digit (bug #33662)

This commit is contained in:
Sebastien Helleu
2011-06-28 13:38:55 +02:00
parent 19bc95b961
commit a6873b725f
2 changed files with 8 additions and 9 deletions
+6 -9
View File
@@ -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)