Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [PATCH] gitweb: fixes to gitweb feature check code

From: Giuseppe Bilotta <hidden>
Date: 2016-06-15 22:45:39

Forgot the sign-off line

On Sat, Nov 15, 2008 at 3:26 PM, Giuseppe Bilotta
[off-list ref] wrote:
The gitweb_check_feature routine was being used for two different
purposes: retrieving the actual feature value (such as the list of
snapshot formats or the list of additional actions), and to check if a
feature was enabled.

For the latter use, since all features return an array, it led to either
clumsy code or subtle bugs, with disabled features appearing enabled
because (0) evaluates to 1.

We fix these bugs, and simplify the code, by separating feature (list)
value retrieval (gitweb_get_feature) from boolean feature check (i.e.
retrieving the first/only item in the feature value list). Usage of
gitweb_check_feature across gitweb is replaced by the appropriate call
wherever needed.
Signed-off-by: Giuseppe Bilotta <redacted>

-- 
Giuseppe "Oblomov" Bilotta
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help