index: move $params declaration to lsort()
authorTimothy Gu <timothygu99@gmail.com>
Sat, 7 Jun 2014 23:28:31 +0000 (01:28 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Jun 2014 23:32:59 +0000 (01:32 +0200)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
index.cgi

index d61a1ef..c62868b 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -77,10 +77,9 @@ sub repcmp {
 };
 
 (my $uri = $ENV{REQUEST_URI}) =~ s/\?.*//;
-my $params = join '&', map param($_), grep $_ !~ 'sort', param;
-$params .= '&' if $params;
-
 sub lsort {
+    my $params = join '&', map param($_), grep $_ !~ 'sort', param;
+    $params .= '&' if $params;
     my ($text, $key, $p) = @_;
     if ($sort eq $key) {
         $p = param('asort') ? 'dsort' : 'asort';