Code

gitweb: Use nonlocal jump instead of 'exit' in die_error
[git.git] / gitweb / gitweb.perl
index a2d2283ec921acac7b068537eb85f63c16de9556..ed92dcac083d6644998ef68810409624abbbb417 100755 (executable)
@@ -972,11 +972,16 @@ if ($action !~ m/^(?:opml|project_list|project_index)$/ &&
        die_error(400, "Project needed");
 }
 $actions{$action}->();
-exit;
+DONE_GITWEB:
+1;
 
 ## ======================================================================
 ## action links
 
+# possible values of extra options
+# -full => 0|1      - use absolute/full URL ($my_uri/$my_url as base)
+# -replay => 1      - start from a current view (replay with modifications)
+# -path_info => 0|1 - don't use/use path_info URL (if possible)
 sub href {
        my %params = @_;
        # default is to use -absolute url() i.e. $my_uri
@@ -993,7 +998,8 @@ sub href {
        }
 
        my $use_pathinfo = gitweb_check_feature('pathinfo');
-       if ($use_pathinfo and defined $params{'project'}) {
+       if (defined $params{'project'} &&
+           (exists $params{-path_info} ? $params{-path_info} : $use_pathinfo)) {
                # try to put as many parameters as possible in PATH_INFO:
                #   - project name
                #   - action
@@ -2216,8 +2222,7 @@ sub config_to_multi {
 sub git_get_project_config {
        my ($key, $type) = @_;
 
-       # do we have project
-       return unless (defined $project && defined $git_dir);
+       return unless defined $git_dir;
 
        # key sanity check
        return unless ($key);
@@ -3428,7 +3433,7 @@ EOF
        print "</div>\n";
 
        git_footer_html();
-       exit;
+       goto DONE_GITWEB;
 }
 
 ## ----------------------------------------------------------------------