[interchange-cvs] interchange - jon modified code/UserTag/history_scan.tag

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Mon Jul 15 15:09:01 2002


User:      jon
Date:      2002-07-15 19:08:06 GMT
Modified:  code/UserTag history_scan.tag
Log:
Handle count option more sensibly.

Revision  Changes    Path
1.4       +1 -2      interchange/code/UserTag/history_scan.tag


rev 1.4, prev_rev 1.3
Index: history_scan.tag
=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: /var/cvs/interchange/code/UserTag/history_scan.tag,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- history_scan.tag	15 Jul 2002 18:13:36 -0000	1.3
+++ history_scan.tag	15 Jul 2002 19:08:06 -0000	1.4
@@ -12,7 +12,7 @@
 	my $ref =3D $Vend::Session->{History} or return $Tag->area($default);
 	my ($hist, $href, $cgi);
 	$exclude =3D qr/$exclude/ if $exclude;
-	for(my $i =3D $#$ref; $i >=3D 0; $i--) {
+	for (my $i =3D $#$ref - abs($opt->{count}); $i >=3D 0; $i--) {
 		next if $ref->[$i][0] eq 'expired';
 		#Log("checking $ref->[$i][0] for $exclude");
 		if ($exclude and $ref->[$i][0] =3D~ $exclude) {
@@ -21,7 +21,6 @@
 		if($find) {
 			next unless $ref->[$i][0] =3D~ /$find/;
 		}
-		next if abs($opt->{count}) >=3D (@$ref - $i);
 		($href, $cgi) =3D @{$ref->[$i]};
 		last;
 	}