From 683227b8432fdbae4d0553d1549335047e641bfa Mon Sep 17 00:00:00 2001 From: Noritada Kobayashi Date: Mon, 26 Nov 2007 20:44:18 +0900 Subject: [PATCH] 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. --- lib/Packages/Search.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.39.2