From: Junio C Hamano Date: Tue, 1 Aug 2006 04:00:16 +0000 (-0700) Subject: gitweb: avoid undefined value warning in print_page_path X-Git-Tag: v1.4.3-rc1~274^2~27 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5d1acf4da0d22d73c6b5d70887003d8fa7642ecc;p=git.git gitweb: avoid undefined value warning in print_page_path The function unconditionally tried to match $type but some callers did not pass it. Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi index 3cd4ce2a0..9dc300d45 100755 --- a/gitweb/gitweb.cgi +++ b/gitweb/gitweb.cgi @@ -1035,7 +1035,7 @@ sub git_print_page_path { if (!defined $name) { print "
/
\n"; - } elsif ($type =~ "blob") { + } elsif (defined $type && $type eq 'blob') { print "
" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;f=$file_name")}, esc_html($name)) . "
\n"; } else { @@ -1550,7 +1550,7 @@ sub git_blame { " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;f=$file_name")}, "head"); git_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav); git_header_div('commit', esc_html($co{'title'}), $hash_base); - git_print_page_path($file_name); + git_print_page_path($file_name, 'blob'); print "
\n"; print < @@ -1773,7 +1773,7 @@ sub git_tree { if (defined $file_name) { $base = esc_html("$file_name/"); } - git_print_page_path($file_name); + git_print_page_path($file_name, 'tree'); print "
\n"; print "\n"; my $alternate = 0;