X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/55ac326ecb01161bf62865ae3350acf85db97d63..e5ca46bf4b974ce3b51d09da4c7ad741aaa70ede:/ui-shared.c diff --git a/ui-shared.c b/ui-shared.c index 7c69f60..60aa2e3 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -272,6 +272,12 @@ void cgit_diff_link(char *name, char *title, char *class, char *head, html(""); } +void cgit_patch_link(char *name, char *title, char *class, char *head, + char *rev) +{ + reporevlink("patch", name, title, class, head, rev, NULL); +} + void cgit_object_link(struct object *obj) { char *page, *arg, *url; @@ -304,6 +310,8 @@ void cgit_print_date(time_t secs, char *format) char buf[64]; struct tm *time; + if (!secs) + return; time = gmtime(&secs); strftime(buf, sizeof(buf)-1, format, time); html_txt(buf); @@ -313,6 +321,8 @@ void cgit_print_age(time_t t, time_t max_relative, char *format) { time_t now, secs; + if (!t) + return; time(&now); secs = now - t; @@ -358,12 +368,14 @@ void cgit_print_docstart(char *title, struct cacheitem *item) ttl_seconds(item->ttl))); html("\n"); html(cgit_doctype); - html("\n"); + html("\n"); html("
\n"); html("