From: Frank Lichtenheld Date: Mon, 29 Oct 2007 23:43:30 +0000 (+0100) Subject: Packages::Dispatcher: Fix parsing error of pathinfo X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=f0675aeb4cc30c44a2f62d8f9c705ddd84fbdb48;p=deb%2Fpackages.git Packages::Dispatcher: Fix parsing error of pathinfo Only take away and 'source' from the pathinfo if something actually follows after that. Otherwise we will just emit a confusing error message. In doubt better interpret this as a search term. Reported by Paul Wise. --- diff --git a/lib/Packages/Dispatcher.pm b/lib/Packages/Dispatcher.pm index ff68426..4da8c56 100755 --- a/lib/Packages/Dispatcher.pm +++ b/lib/Packages/Dispatcher.pm @@ -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 ); }