From: Junio C Hamano Date: Sun, 17 Sep 2006 21:34:12 GMT Subject: Re: [PATCH] gitweb: fix warnings from dd70235f5a81e (PATH_INFO) Message-ID: <7vfyeq2n57.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20060917121408.GA19860@moooo.ath.cx> Matthias Lederhofer writes: > We really need a gitweb test target. Yes, really. Any takers who cares truly about gitweb? > Something else I noted: >> + while ($project && !-e "$projectroot/$project/HEAD") { > Evaluating $project boolean value leads to problems if a repository is > named "0" (I dunno if there are other strings than "" and "0" which > evaluate to false in perl). There are multiple places where this is > used so I did not change it in this patch (even added one more). > Should this be changed? Yes, there are tons of places that says if ($foo) and/or while ($bar) and fail miserably when $foo or $bar _can_ be "0". For project names "0" is probably not something people would want to use but there is no inherent reason to forbid it. How many places, like this, that we should say "defined()" instead in the current code I wonder? > - } elsif ($path_info =~ m,^$project/([^/]+)$,) { > + } elsif ($project && $path_info =~ m,^$project/([^/]+)$,) {