Code

gitweb: Protect against possible warning in git_commitdiff
authorJakub Narebski <jnareb@gmail.com>
Sat, 18 Nov 2006 22:35:38 +0000 (23:35 +0100)
committerJunio C Hamano <junkio@cox.net>
Tue, 21 Nov 2006 22:35:40 +0000 (14:35 -0800)
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>
gitweb/gitweb.perl

index 758759576cbbac596b15dd4940aca24ff6dbdd84..b2482febfc50446b17bd7ce1611407c548ee781d 100755 (executable)
@@ -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;