X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/c0dfaf1c281d0697ce43131343d7a9f170a61ff9..96ceb9a95a7a321209cff347fefd141a9fffc7ca:/ui-repolist.c diff --git a/ui-repolist.c b/ui-repolist.c index 2ab6e9e..f929cb7 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -1,7 +1,6 @@ /* ui-repolist.c: functions for generating the repolist page * - * Copyright (C) 2006 Lars Hjemli - * Copyright (C) 2012 Jason A. Donenfeld + * Copyright (C) 2006-2014 cgit Development Team * * Licensed under GNU General Public License v2 * (see COPYING for full license text) @@ -18,16 +17,17 @@ static time_t read_agefile(char *path) time_t result; size_t size; char *buf; - static char buf2[64]; + struct strbuf date_buf = STRBUF_INIT; if (readfile(path, &buf, &size)) return -1; - if (parse_date(buf, buf2, sizeof(buf2)) > 0) - result = strtoul(buf2, NULL, 10); + if (parse_date(buf, &date_buf) == 0) + result = strtoul(date_buf.buf, NULL, 10); else result = 0; free(buf); + strbuf_release(&date_buf); return result; } @@ -100,14 +100,16 @@ static int is_in_url(struct cgit_repo *repo) { if (!ctx.qry.url) return 1; - if (repo->url && !prefixcmp(repo->url, ctx.qry.url)) + if (repo->url && starts_with(repo->url, ctx.qry.url)) return 1; return 0; } static void print_sort_header(const char *title, const char *sort) { - htmlf(""); + html_txt(ctx.repo->owner); + html(""); + } html(""); } print_modtime(ctx.repo); @@ -332,13 +346,7 @@ void cgit_print_site_readme() { if (!ctx.cfg.root_readme) return; - if (ctx.cfg.about_filter) { - ctx.cfg.about_filter->argv[1] = ctx.cfg.root_readme; - cgit_open_filter(ctx.cfg.about_filter); - } + cgit_open_filter(ctx.cfg.about_filter, ctx.cfg.root_readme); html_include(ctx.cfg.root_readme); - if (ctx.cfg.about_filter) { - cgit_close_filter(ctx.cfg.about_filter); - ctx.cfg.about_filter->argv[1] = NULL; - } + cgit_close_filter(ctx.cfg.about_filter); }