Skip to content

Commit c42b00c

Browse files
jnarebgitster
authored andcommitted
gitweb: Use nonlocal jump instead of 'exit' in die_error
Use 'goto DONE' in place of 'exit' to end request processing in die_error() subroutine. While at it, do not end gitweb with 'exit'. This would make it easier in the future to add support or improve support for persistent environments such as FastCGI and mod_perl. It would also make it easier to make use of die_error() as an error handler (for fatalsToBrowser). Perl 5 allows non-local jumps; the restriction is that you cannot jump into a scope. Signed-off-by: Jakub Narebski <[email protected]> Acked-by: Petr Baudis <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 377bee3 commit c42b00c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gitweb/gitweb.perl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,8 @@ sub evaluate_path_info {
972972
die_error(400, "Project needed");
973973
}
974974
$actions{$action}->();
975-
exit;
975+
DONE_GITWEB:
976+
1;
976977

977978
## ======================================================================
978979
## action links
@@ -3432,7 +3433,7 @@ sub die_error {
34323433
print "</div>\n";
34333434

34343435
git_footer_html();
3435-
exit;
3436+
goto DONE_GITWEB;
34363437
}
34373438

34383439
## ----------------------------------------------------------------------

0 commit comments

Comments
 (0)