git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: Fix few 'use of undefined value' warnings

From
Petr Baudis <pasky@suse.cz>
Date
Apr 27, 2007, 16:43 UTC
Message-ID
<20070427164352.396.54191.stgit@rover>
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 gitweb/gitweb.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b67ce41..b51103e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1038,6 +1038,7 @@ sub git_get_hash_by_path {
 		or die_error(undef, "Open git-ls-tree failed");
 	my $line = <$fd>;
 	close $fd or return undef;
+	$line or return undef;
 
 	#'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa	panic.c'
 	$line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t/;
@@ -1057,6 +1058,7 @@ sub git_get_project_description {
 	open my $fd, "$projectroot/$path/description" or return undef;
 	my $descr = <$fd>;
 	close $fd;
+	$descr or return undef;
 	chomp $descr;
 	return $descr;
 }
@@ -1208,6 +1210,7 @@ sub git_get_last_activity {
 	     'refs/heads') or return;
 	my $most_recent = <$fd>;
 	close $fd or return;
+	$most_recent or return;
 	if ($most_recent =~ / (\d+) [-+][01]\d\d\d$/) {
 		my $timestamp = $1;
 		my $age = time - $timestamp;
Next: Junio C Hamano
Message 1 of 5 in “gitweb: Fix few 'use of undefined value' warnings”
  1. gitweb: Fix few 'use of undefined value' warningsPetr Baudis, Apr 27, 2007
  2. Junio C HamanoApr 29, 2007
  3. Petr BaudisMay 17, 2007
  4. Junio C HamanoMay 17, 2007
  5. Petr BaudisMay 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.