Skip to content

Commit

Permalink
gitweb: Protect against possible warning in git_commitdiff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Nov 21, 2006
1 parent 6994560 commit 04408c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3731,7 +3731,8 @@ sub git_commitdiff {
$hash_parent, $hash, "--"
or die_error(undef, "Open git-diff-tree failed");

while (chomp(my $line = <$fd>)) {
while (my $line = <$fd>) {
chomp $line;
# empty line ends raw part of diff-tree output
last unless $line;
push @difftree, $line;
Expand Down

0 comments on commit 04408c3

Please sign in to comment.