[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sun Sep 1 18:08:01 2002


User:      heins
Date:      2002-09-01 22:07:05 GMT
Modified:  lib/Vend Tag: STABLE_4_8-branch Interpolate.pm
Log:
* Add ellipsis feature for length filter (i.e. [filter 20.] back in
  after someone (most likely me, though I rarely touch stable branch)
  removed it in 4.8.3.

Revision  Changes    Path
No                   revision



No                   revision



2.9.2.20  +7 -2      interchange/lib/Vend/Interpolate.pm


rev 2.9.2.20, prev_rev 2.9.2.19
Index: Interpolate.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.9.2.19
retrieving revision 2.9.2.20
diff -u -r2.9.2.19 -r2.9.2.20
--- Interpolate.pm	23 Jul 2002 22:34:01 -0000	2.9.2.19
+++ Interpolate.pm	1 Sep 2002 22:07:02 -0000	2.9.2.20
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 #=20
-# $Id: Interpolate.pm,v 2.9.2.19 2002/07/23 22:34:01 racke Exp $
+# $Id: Interpolate.pm,v 2.9.2.20 2002/09/01 22:07:02 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -27,7 +27,7 @@
 require Exporter;
 @ISA =3D qw(Exporter);
=20
-$VERSION =3D substr(q$Revision: 2.9.2.19 $, 10);
+$VERSION =3D substr(q$Revision: 2.9.2.20 $, 10);
=20
 @EXPORT =3D qw (
=20
@@ -632,6 +632,11 @@
 		@args =3D ();
 		if(/%/) {
 			$value =3D sprintf($_, $value);
+			next;
+		}
+		if (/^(\d+)(\.?)$/) {
+			substr($value, $1) =3D $2 ? '...' : ''
+				if length($value) > $1;
 			next;
 		}
 		while( s/\.([^.]+)$//) {