Upgrade to Term::ANSIColor 1.10
[p5sagit/p5-mst-13.2.git] / lib / Term / ANSIColor.pm
index 68955ce..ef27ae9 100644 (file)
@@ -1,8 +1,8 @@
 # Term::ANSIColor -- Color screen output using ANSI escape sequences.
-# $Id: ANSIColor.pm,v 1.9 2004/12/04 01:29:12 eagle Exp $
+# $Id: ANSIColor.pm,v 1.10 2005/08/21 18:31:58 eagle Exp $
 #
-# Copyright 1996, 1997, 1998, 2000, 2001, 2002
-#   by Russ Allbery <rra@stanford.edu> and Zenin <zenin@bawdycaste.com>
+# Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005
+#   by Russ Allbery <rra@stanford.edu> and Zenin
 #
 # This program is free software; you may redistribute it and/or modify it
 # under the same terms as Perl itself.
@@ -34,7 +34,7 @@ Exporter::export_ok_tags ('constants');
 
 # Don't use the CVS revision as the version, since this module is also in Perl
 # core and too many things could munge CVS magic revision strings.
-$VERSION = 1.09;
+$VERSION = '1.10';
 
 ##############################################################################
 # Internal data structures
@@ -182,8 +182,9 @@ sub colored {
     if (defined $EACHLINE) {
         my $attr = color (@codes);
         join '',
-            map { $_ && $_ ne $EACHLINE ? $attr . $_ . "\e[0m" : $_ }
-                split (/(\Q$EACHLINE\E)/, $string);
+            map { $_ ne $EACHLINE ? $attr . $_ . "\e[0m" : $_ }
+                grep { length ($_) > 0 }
+                    split (/(\Q$EACHLINE\E)/, $string);
     } else {
         color (@codes) . $string . "\e[0m";
     }
@@ -465,7 +466,7 @@ with input from Zenin.  Russ Allbery now maintains this module.
 =head1 COPYRIGHT AND LICENSE
 
 Copyright 1996, 1997, 1998, 2000, 2001, 2002 Russ Allbery <rra@stanford.edu>
-and Zenin <zenin@bawdycaste.org>.  This program is free software; you may
-redistribute it and/or modify it under the same terms as Perl itself.
+and Zenin.  This program is free software; you may redistribute it and/or
+modify it under the same terms as Perl itself.
 
 =cut