Re: [PATCH] gitweb: fix warnings from dd70235f5a81e (PATH_INFO)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthias Lederhofer <matled@xxxxxxx> 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/([^/]+)$,) {

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]