threads / patch / 3984

patchannotate: fix warning about uninitialized scalar

Subject: [PATCH] annotate: fix warning about uninitialized scalar

## tl;dr

One message between Apr 28, 2006 and Apr 28, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Matthias Kestenholz· Apr 28, 2006, 08:42 UTC · lore

Use of uninitialized value in scalar chomp at ./git-annotate.perl line 212, <$kid> chunk 4.

Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
---
 git-annotate.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
5322aefa820eef2d635d5dbf621269aefce52135
Show changes to git-annotate.perl +3 −0
diff --git a/git-annotate.perl b/git-annotate.perl
index bf920a5..5f8a766 100755
--- a/git-annotate.perl
+++ b/git-annotate.perl
@@ -209,6 +209,9 @@ sub find_parent_renames {
 	while (my $change = <$patch>) {
 		chomp $change;
 		my $filename = <$patch>;
+		if(!$filename) {
+			next;
+		}
 		chomp $filename;
 
 		if ($change =~ m/^[AMD]$/ ) {
-- 
1.3.1.gc4586

← back to recent threads