X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/e01229cf80bc618a132d2154c0ebd71792d31c64..f8f6e1fe789e9dbcea40a0f8d5ebfb019c2a1a19:/ui-repolist.c?ds=sidebyside diff --git a/ui-repolist.c b/ui-repolist.c index 3ef2e99..dce2eac 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -6,12 +6,6 @@ * (see COPYING for full license text) */ -/* This is needed for strcasestr to be defined by */ -#define _GNU_SOURCE 1 -#include - -#include - #include "cgit.h" #include "html.h" #include "ui-shared.h" @@ -26,7 +20,7 @@ time_t read_agefile(char *path) if (readfile(path, &buf, &size)) return -1; - if (parse_date(buf, buf2, sizeof(buf2))) + if (parse_date(buf, buf2, sizeof(buf2)) > 0) result = strtoul(buf2, NULL, 10); else result = 0; @@ -52,11 +46,20 @@ static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime) } path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch); - if (stat(path, &s) == 0) + if (stat(path, &s) == 0) { *mtime = s.st_mtime; - else - *mtime = 0; + r->mtime = *mtime; + return 1; + } + + path = fmt("%s/%s", repo->path, "packed-refs"); + if (stat(path, &s) == 0) { + *mtime = s.st_mtime; + r->mtime = *mtime; + return 1; + } + *mtime = 0; r->mtime = *mtime; return (r->mtime != 0); } @@ -94,7 +97,7 @@ int is_in_url(struct cgit_repo *repo) void print_sort_header(const char *title, const char *sort) { - htmlf("