@matheusbsbs / matheus-bagliano / commits / 0bdb28c9cc
Fork 0

gitweb: Fix git_patchset_body not closing <div class="patch">

Fix case when git_patchset_body didn't close <div class="patch">, for patchsets with last patch empty. This patch also removes some commented out code in git_patchset_body. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Jan 10, 2007 at 00:07 UTC 0bdb28c9ccd85b1c606664154b6f6d39a4c315fd
1 file changed +4 -3
gitweb/gitweb.perl
+4 -3
@@ -2412,7 +2412,6 @@ sub git_patchset_body {
2412
2413 push @diff_header, $patch_line;
2414 }
2415 - #last PATCH unless $patch_line;
2415 my $last_patch_line = $patch_line;
2416
2417 # check if current patch belong to current raw line
@@ -2522,7 +2521,10 @@ sub git_patchset_body {
2521
2522 # from-file/to-file diff header
2523 $patch_line = $last_patch_line;
2525 - last PATCH unless $patch_line;
2524 + if (! $patch_line) {
2525 + print "</div>\n"; # class="patch"
2526 + last PATCH;
2527 + }
2528 next PATCH if ($patch_line =~ m/^diff /);
2529 #assert($patch_line =~ m/^---/) if DEBUG;
2530 if ($from{'href'} && $patch_line =~ m!^--- "?a/!) {
@@ -2533,7 +2535,6 @@ sub git_patchset_body {
2535 print "<div class=\"diff from_file\">$patch_line</div>\n";
2536
2537 $patch_line = <$fd>;
2536 - #last PATCH unless $patch_line;
2538 chomp $patch_line;
2539
2540 #assert($patch_line =~ m/^+++/) if DEBUG;