[Templates-cvs] cvs commit: Template2/lib/Template Filters.pm

cvs@template-toolkit.org cvs@template-toolkit.org


cvs         06/01/30 17:05:35

  Modified:    lib/Template Filters.pm
  Log:
  * fixed truncate() to not truncate if the string is as long as the
    limit (changed < to <= )
  
  Revision  Changes    Path
  2.80      +3 -3      Template2/lib/Template/Filters.pm
  
  Index: Filters.pm
  ===================================================================
  RCS file: /template-toolkit/Template2/lib/Template/Filters.pm,v
  retrieving revision 2.79
  retrieving revision 2.80
  diff -u -r2.79 -r2.80
  --- Filters.pm	2006/01/30 14:56:17	2.79
  +++ Filters.pm	2006/01/30 17:05:34	2.80
  @@ -18,7 +18,7 @@
   #
   #----------------------------------------------------------------------------
   #
  -# $Id: Filters.pm,v 2.79 2006/01/30 14:56:17 abw Exp $
  +# $Id: Filters.pm,v 2.80 2006/01/30 17:05:34 abw Exp $
   #
   #============================================================================
   
  @@ -31,7 +31,7 @@
   use vars qw( $VERSION $DEBUG $FILTERS $URI_ESCAPES $PLUGIN_FILTER );
   use Template::Constants;
   
  -$VERSION = sprintf("%d.%02d", q$Revision: 2.79 $ =~ /(\d+)\.(\d+)/);
  +$VERSION = sprintf("%d.%02d", q$Revision: 2.80 $ =~ /(\d+)\.(\d+)/);
   
   
   #------------------------------------------------------------------------
  @@ -487,7 +487,7 @@
   
       return sub {
           my $text = shift;
  -        return $text if length $text < $len;
  +        return $text if length $text <= $len;
           return substr($text, 0, $len - length($char)) . $char;
       }
   }