From: Noritada Kobayashi Date: Mon, 26 Nov 2007 11:44:18 +0000 (+0900) Subject: Search.pm: Avoid printing empty items in the similar packages list. X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=683227b8432fdbae4d0553d1549335047e641bfa;p=deb%2Fpackages.git Search.pm: Avoid printing empty items in the similar packages list. Consider conditions where the number of similar packages are less than 11, avoiding printing "
  • " in the similar packages list. --- diff --git a/lib/Packages/Search.pm b/lib/Packages/Search.pm index 52f451e..04270f2 100644 --- a/lib/Packages/Search.pm +++ b/lib/Packages/Search.pm @@ -282,7 +282,9 @@ sub find_similar { undef $db; debug ("ORDER: @order", 2) if DEBUG; - return @order[0..10]; + my $last = 10; + $last = $#order if $#order < $last; + return @order[0..$last]; } sub find_binaries {