Re: [PATCH] gitweb: fix warnings from dd70235f5a81e (PATH_INFO)
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:40
Matthias Lederhofer [off-list ref] writes:
We really need a gitweb test target.
Yes, really. Any takers who cares truly about gitweb?
Something else I noted:quoted
+ 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/([^/]+)$,) {