Skip Menu |

This queue is for tickets about the Text-FormatTable CPAN distribution.

Report information
The Basics
Id: 34546
Status: resolved
Priority: 0/
Queue: Text-FormatTable

People
Owner: treyharris [...] gmail.com
Requestors: penny [...] she.geek.nz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.01
  • 0.01
  • 1.00
  • 1.02
Fixed in: (no value)



Subject: Warning raised when no minimum width
Attached patch to set to 0 rather than undef, which cases warning in addition. This is reproducable with a table with header only, including a column with "".
Subject: minwidth.patch
--- /usr/share/perl5/Text/FormatTable.pm 2008-03-02 17:25:48.000000000 +1300 +++ FormatTable.pm 2008-03-30 12:33:18.000000000 +1300 @@ -40,7 +40,7 @@ my $l = length $s; $min = $l if not defined $min or $l > $min; } - return $min; + return $min ? $min : 0 } # width of $1 if not word-wrapped
From: penny [...] she.geek.nz
Sorry, this patch is better. I didn't realise 0 wouldn't fix it, that caused division by 0 errors :) On Sat Mar 29 19:35:54 2008, mjollnir wrote: Show quoted text
> Attached patch to set to 0 rather than undef, which cases warning in > addition. > > This is reproducable with a table with header only, including a column > with "".
--- /usr/share/perl5/Text/FormatTable.pm 2008-03-02 17:25:48.000000000 +1300 +++ src/textformatperl/FormatTable.pm 2008-03-30 12:53:41.000000000 +1300 @@ -40,14 +40,14 @@ my $l = length $s; $min = $l if not defined $min or $l > $min; } - return $min; + return $min ? $min : 1; } # width of $1 if not word-wrapped sub _max_width($) { my $str = shift; - return length $str; + return length $str ? length $str : 1; } sub _max($$)
Fixed in v1.03, available on github now or CPAN tomorrow