]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/Dispatcher.pm
Packages::Dispatcher: Fix parsing error of pathinfo
[deb/packages.git] / lib / Packages / Dispatcher.pm
index ff6842687b9a7536a6c872312fae24d89990f1e3..4da8c568455a3f7b2b4ec058369af4a968c93186 100755 (executable)
@@ -147,11 +147,11 @@ sub do_dispatch {
        push @components, 'index' if @components && $path =~ m,/$,;
 
        my %LANGUAGES = map { $_ => 1 } @all_langs;
-       if (@components > 0 and $LANGUAGES{$components[0]}
+       if (@components > 1 and $LANGUAGES{$components[0]}
            and !$input->param('lang')) {
            $input->param( 'lang', shift(@components) );
        }
-       if (@components > 0 and $components[0] eq 'source') {
+       if (@components > 1 and $components[0] eq 'source') {
            shift @components;
            $input->param( 'source', 1 );
        }