@matheusbsbs / matheus-bagliano / commits / 04408c3578
Fork 0

gitweb: Protect against possible warning in git_commitdiff

We may read an undef from <$fd> and unconditionally chomping it would result in a warning. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Nov 18, 2006 at 23:35 UTC 04408c3578300ac7cc1b1530bbaec54de299b200
1 file changed +2 -1
gitweb/gitweb.perl
+2 -1
@@ -3731,7 +3731,8 @@ sub git_commitdiff {
3731 $hash_parent, $hash, "--"
3732 or die_error(undef, "Open git-diff-tree failed");
3733
3734 - while (chomp(my $line = <$fd>)) {
3734 + while (my $line = <$fd>) {
3735 + chomp $line;
3736 # empty line ends raw part of diff-tree output
3737 last unless $line;
3738 push @difftree, $line;