]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Use nonlocal jump instead of 'exit' in die_error
[Gitweb] / gitweb.perl
index 9e4bd619b4a392736261780167e3661e2f9ad6d3d07549a34b49422dbb656462..bebb1a33fb2e5b8fabdec5549e1107c4810037b3c3a2d008cfb173466b6c1046 100755 (executable)
@@ -973,11 +973,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
@@ -994,7 +999,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
@@ -2217,8 +2223,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);
@@ -3429,7 +3434,7 @@ EOF
        print "</div>\n";
 
        git_footer_html();
-       exit;
+       goto DONE_GITWEB;
 }
 
 ## ----------------------------------------------------------------------
This page took 0.217463 seconds and 4 git commands to generate.