According to http://www.mirc.com/help/color.txt , always using two-digit
color codes eliminates problems with certain strings that contain color
codes immediately followed by numbers in text. The attached patch
implements this fix. To see the problem, just try coloring a string that
starts with the number "1" (for example).
Thanks.
--
--kulp
Subject: | IRC.diff |
--- /tmp/IRC.pm 2008-11-06 19:36:11.000000000 -0600
+++ /tmp/IRC.pm.new 2008-11-06 19:36:04.000000000 -0600
@@ -55,10 +55,11 @@
*{__PACKAGE__.'::'.$color} = sub {
my $color_code = "";
+ my $formatted = sprintf("%02d", $code);
if ($_[1] && exists $color_name_table{ $_[1] }) {
- $color_code .= "$code,$color_name_table{ $_[1] }";
+ $color_code .= "$formatted,$color_name_table{ $_[1] }";
} else {
- $color_code .= "$code";
+ $color_code .= "$formatted";
}
$_[0]->_add_code_l("$color_code");
};