summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-06-28 13:38:55 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-06-28 13:38:55 +0200
commita6873b725f3edfe63b61d16b434e06008bce1989 (patch)
treed4bca3cfa3d6fc5131c56f2475743a713c693ab8
parent19bc95b96189de5a645adbe7b3487d5de1b835e7 (diff)
downloadweechat-a6873b725f3edfe63b61d16b434e06008bce1989.zip
irc: fix bug with comma in irc color code: do not strip comma if it is not followed by a digit (bug #33662)
-rw-r--r--ChangeLog2
-rw-r--r--src/plugins/irc/irc-color.c15
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)