Re: [PATCH] gitweb: fix warnings from dd70235f5a81e (PATH_INFO)
- From
Junio C Hamano <junkio@cox.net>
- Date
- Sep 17, 2006, 21:34 UTC
- Message-ID
- <7vfyeq2n57.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20060917121408.GA19860@moooo.ath.cx>
Matthias Lederhofer <matled@gmx.net> writes:
> We really need a gitweb test target.
Yes, really. Any takers who cares truly about gitweb?
Show 7 quoted lines
> 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/([^/]+)$,) {