aboutsummaryrefslogtreecommitdiff
path: root/ui-shared.c
diff refs
from:
to:
flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/ui-shared.c b/ui-shared.c
index df52a9b..4250b89 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -832,7 +832,7 @@ void cgit_print_docstart(void)
else
emit_js_link(NULL, "/cgit.js");
- if (ctx.cfg.favicon && *ctx.cfg.favicon) {
+ if (ctx.cfg.favicon) {
html("<link rel='shortcut icon' href='");
html_attr(ctx.cfg.favicon);
html("'/>\n");
@@ -889,18 +889,13 @@ void cgit_print_docend(void)
void cgit_print_error_page(int code, const char *msg, const char *fmt, ...)
{
va_list ap;
- va_start(ap, fmt);
- cgit_vprint_error_page(code, msg, fmt, ap);
- va_end(ap);
-}
-
-void cgit_vprint_error_page(int code, const char *msg, const char *fmt, va_list ap)
-{
ctx.page.expires = ctx.cfg.cache_dynamic_ttl;
ctx.page.status = code;
ctx.page.statusmsg = msg;
cgit_print_layout_start();
+ va_start(ap, fmt);
cgit_vprint_error(fmt, ap);
+ va_end(ap);
cgit_print_layout_end();
}
@@ -941,9 +936,10 @@ void cgit_add_clone_urls(void (*fn)(const char *))
add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url);
}
-static int print_branch_option(const struct reference *ref, void *cb_data)
+static int print_branch_option(const char *refname, const char *referent UNUSED,
+ const struct object_id *oid, int flags, void *cb_data)
{
- char *name = (char *)ref->name;
+ char *name = (char *)refname;
html_option(name, name, ctx.qry.head);
return 0;
}
@@ -1158,7 +1154,7 @@ void cgit_print_pageheader(void)
html("<div class='path'>");
html("path: ");
cgit_print_path_crumbs(ctx.qry.vpath);
- if (ctx.repo->enable_follow_links && !strcmp(ctx.qry.page, "log")) {
+ if (ctx.cfg.enable_follow_links && !strcmp(ctx.qry.page, "log")) {
html(" (");
ctx.qry.follow = !ctx.qry.follow;
cgit_self_link(ctx.qry.follow ? "follow" : "unfollow",