git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] difftool: silence uninitialized variable warning
@ 2013-02-20  5:35 David Aguilar
  2013-02-20  5:35 ` [PATCH v2 2/4] t7800: update copyright notice David Aguilar
  0 siblings, 1 reply; 5+ messages in thread
From: David Aguilar @ 2013-02-20  5:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Jonathan Nieder

Git::config() returns `undef` when given keys that do not exist.
Check that the $guitool value is defined to prevent a noisy
"Use of uninitialized variable $guitool in length" warning.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
Unchanged from last time but included in the series for convenience.

 git-difftool.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-difftool.perl b/git-difftool.perl
index 0a90de4..12231fb 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -336,7 +336,7 @@ sub main
 	}
 	if ($opts{gui}) {
 		my $guitool = Git::config('diff.guitool');
-		if (length($guitool) > 0) {
+		if (defined($guitool) && length($guitool) > 0) {
 			$ENV{GIT_DIFF_TOOL} = $guitool;
 		}
 	}
-- 
1.8.2.rc0.20.gf548dd7

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-20  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20  5:35 [PATCH v2 1/4] difftool: silence uninitialized variable warning David Aguilar
2013-02-20  5:35 ` [PATCH v2 2/4] t7800: update copyright notice David Aguilar
2013-02-20  5:35   ` [PATCH v2 3/4] t7800: modernize tests David Aguilar
2013-02-20  5:35     ` [PATCH v2 4/4] t7800: "defaults" is no longer a builtin tool name David Aguilar
2013-02-20  7:05     ` [PATCH v2 3/4] t7800: modernize tests Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).