Skip Menu |

This queue is for tickets about the String-IRC CPAN distribution.

Report information
The Basics
Id: 40736
Status: resolved
Priority: 0/
Queue: String-IRC

People
Owner: hirose31 [...] gmail.com
Requestors: kulp [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: (no value)



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"); };
applied your patch and just shipit 0.04. Thank you for your report!!