Subject: [PATCH 8/9] gitweb: PATH_INFO=/ means no project

From: Jakub Narebski <[email-masked]>
Date: Sat, 05 Aug 2006 13:16:03 +0200

Prepared for refactoring input validation.

Signed-off-by: Jakub Narebski <[email-masked]>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 013bfe7..2e1a2ba 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -86,8 +86,8 @@ if (defined $action) {
 }
 
 our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
-if (defined $project) {
-       $project =~ s|^/||; $project =~ s|/$||;
+$project =~ s|^/||; $project =~ s|/$||;
+if (defined $project && $project) {
        if (!validate_input($project)) {
                die_error(undef, "Invalid project parameter");
        }
-- 
1.4.1.1