Redirect to man page if there's only one search result

This commit is contained in:
Yorhel 2012-07-17 21:33:09 +02:00
parent 53857d5b84
commit c50e864ca3

View file

@ -214,6 +214,8 @@ sub browsesearch {
my $q = $self->reqGet('q')||'';
my $man = $self->dbSearch($q, 150);
return $self->resRedirect("/$man->[0]{name}.".substr($man->[0]{section},0,1), 'temp') if @$man == 1;
$self->htmlHeader(title => 'Search results for '.$q);
h1 'Search results for '.$q;
txt 'Note: This is just a simple case-insensitive prefix match on the man names. In the future we\'ll have more powerful search functionality. Hopefully.';