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

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Thu Oct 10 17:25:00 2002


User:      heins
Date:      2002-10-10 21:24:45 GMT
Modified:  lib/Vend Search.pm
Log:
* Change stupid behavior where last sort_option is forwarded to
  all future unset options; always default to 'none' if not set.

Revision  Changes    Path
2.13      +3 -8      interchange/lib/Vend/Search.pm


rev 2.13, prev_rev 2.12
Index: Search.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: /var/cvs/interchange/lib/Vend/Search.pm,v
retrieving revision 2.12
retrieving revision 2.13
diff -u -r2.12 -r2.13
--- Search.pm	16 Sep 2002 23:06:31 -0000	2.12
+++ Search.pm	10 Oct 2002 21:24:45 -0000	2.13
@@ -1,6 +1,6 @@
 # Vend::Search - Base class for search engines
 #
-# $Id: Search.pm,v 2.12 2002/09/16 23:06:31 mheins Exp $
+# $Id: Search.pm,v 2.13 2002/10/10 21:24:45 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -21,7 +21,7 @@
=20
 package Vend::Search;
=20
-$VERSION =3D substr(q$Revision: 2.12 $, 10);
+$VERSION =3D substr(q$Revision: 2.13 $, 10);
=20
 use strict;
 use vars qw($VERSION);
@@ -1089,18 +1089,13 @@
 	rn	=3D> sub { $_[1] <=3D> $_[0]			},
 );
=20
-	my $last =3D 'none';
 	my $i;
 	my $max =3D 0;
 	for($i =3D 0; $i < @Flds; $i++) {
 		$max =3D $Flds[$i] if $Flds[$i] > $max;
-		if (! $Opts[$i]) {
-			$Opts[$i] =3D $last;
-			next;
-		}
+		$Opts[$i] =3D 'none', next unless $Opts[$i];
 		$Opts[$i] =3D lc $Opts[$i];
 		$Opts[$i] =3D 'none' unless defined $Sort_field{$Opts[$i]};
-		$last =3D $Opts[$i];
 	}
 #::logDebug("sort_search_return: flds=3D'@Flds' opts=3D'@Opts'");
=20