r40715 - in /branches/upstream/libtext-formattable-perl/current: Changes META.yml lib/Text/FormatTable.pm test.pl
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Sat Jul 25 06:18:54 UTC 2009
Author: carnil-guest
Date: Sat Jul 25 06:18:48 2009
New Revision: 40715
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=40715
Log:
[svn-upgrade] Integrating new upstream version, libtext-formattable-perl (1.03)
Modified:
branches/upstream/libtext-formattable-perl/current/Changes
branches/upstream/libtext-formattable-perl/current/META.yml
branches/upstream/libtext-formattable-perl/current/lib/Text/FormatTable.pm
branches/upstream/libtext-formattable-perl/current/test.pl
Modified: branches/upstream/libtext-formattable-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-formattable-perl/current/Changes?rev=40715&op=diff
==============================================================================
--- branches/upstream/libtext-formattable-perl/current/Changes (original)
+++ branches/upstream/libtext-formattable-perl/current/Changes Sat Jul 25 06:18:48 2009
@@ -1,4 +1,8 @@
Revision history for Perl extension Text::FormatTable.
+
+2009-07-24 (1.03)
+ * Fix for rt34546, uninitialized warning generated with a
+ zero-length column
2009-07-23 (1.02)
* Added support for ASCII color sequences. The escape codes are
Modified: branches/upstream/libtext-formattable-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-formattable-perl/current/META.yml?rev=40715&op=diff
==============================================================================
--- branches/upstream/libtext-formattable-perl/current/META.yml (original)
+++ branches/upstream/libtext-formattable-perl/current/META.yml Sat Jul 25 06:18:48 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Text-FormatTable
-version: 1.02
+version: 1.03
abstract: Format text tables
license: perl
author:
Modified: branches/upstream/libtext-formattable-perl/current/lib/Text/FormatTable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-formattable-perl/current/lib/Text/FormatTable.pm?rev=40715&op=diff
==============================================================================
--- branches/upstream/libtext-formattable-perl/current/lib/Text/FormatTable.pm (original)
+++ branches/upstream/libtext-formattable-perl/current/lib/Text/FormatTable.pm Sat Jul 25 06:18:48 2009
@@ -2,9 +2,10 @@
use Carp;
use strict;
+use warnings;
use vars qw($VERSION);
-$VERSION = '1.02';
+$VERSION = '1.03';
=head1 NAME
@@ -48,14 +49,15 @@
my $l = _uncolorized_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 _uncolorized_length $str;
+ my $len = _uncolorized_length $str;
+ return $len ? $len : 1;
}
sub _max($$)
Modified: branches/upstream/libtext-formattable-perl/current/test.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtext-formattable-perl/current/test.pl?rev=40715&op=diff
==============================================================================
--- branches/upstream/libtext-formattable-perl/current/test.pl (original)
+++ branches/upstream/libtext-formattable-perl/current/test.pl Sat Jul 25 06:18:48 2009
@@ -1,7 +1,10 @@
use Test;
-BEGIN { plan tests => 4 };
+BEGIN { plan tests => 5 };
use Text::FormatTable;
ok(1); # If we made it this far, we're ok.
+
+use strict;
+use warnings;
{
my $table = Text::FormatTable->new('r| l l');
@@ -58,3 +61,14 @@
my ($rule) = ($output =~ /(=+)/);
ok(length($rule), length("foo bar bat"));
}
+
+# rt34546, warnings when column has zero length
+{
+ my $warning;
+ local $SIG{__WARN__} = sub { $warning = $_[0] };
+
+ my $table = Text::FormatTable->new('l l');
+ $table->head('foo', q{});
+ my $output = $table->render();
+ ok(not defined $warning);
+}
More information about the Pkg-perl-cvs-commits
mailing list