From mboxrd@z Thu Jan 1 00:00:00 1970 From: tim.nordell at logicpd.com (Tim Nordell) Date: Fri, 4 Mar 2016 17:24:50 -0600 Subject: [PATCH v2 2/8] ui-repolist: Remove conditional around print_header() In-Reply-To: <1457133901-12998-1-git-send-email-tim.nordell@logicpd.com> References: <1456520339-32708-1-git-send-email-tim.nordell@logicpd.com> <1457133901-12998-1-git-send-email-tim.nordell@logicpd.com> Message-ID: <1457133901-12998-3-git-send-email-tim.nordell@logicpd.com> The code has since morphed from the original use case of the conditional for deciding whether or not to print the header. This is guaranteed to always pass due to the earlier check in the function "any_repos_visible()" which emits a 404 page. Signed-off-by: Tim Nordell diff --git a/ui-repolist.c b/ui-repolist.c index 771b330..c240af3 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -272,7 +272,7 @@ static int sort_repolist(char *field) void cgit_print_repolist(void) { - int i, columns = 3, hits = 0, header = 0; + int i, columns = 3, hits = 0; char *last_section = NULL; char *section; int sorted = 0; @@ -301,6 +301,7 @@ void cgit_print_repolist(void) sort_repolist("section"); html(""); + print_header(); for (i = 0; i < cgit_repolist.count; i++) { ctx.repo = &cgit_repolist.repos[i]; if (!is_visible(ctx.repo)) @@ -310,8 +311,6 @@ void cgit_print_repolist(void) continue; if (hits > ctx.qry.ofs + ctx.cfg.max_repo_count) continue; - if (!header++) - print_header(); section = ctx.repo->section; if (section && !strcmp(section, "")) section = NULL; -- 2.4.9