summaryrefslogtreecommitdiffabout
path: root/ui-repolist.c
Unidiff
Diffstat (limited to 'ui-repolist.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-repolist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index 5fde174..cd4e41d 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -1,35 +1,36 @@
1/* ui-repolist.c: functions for generating the repolist page 1/* ui-repolist.c: functions for generating the repolist page
2 * 2 *
3 * Copyright (C) 2006 Lars Hjemli 3 * Copyright (C) 2006 Lars Hjemli
4 * 4 *
5 * Licensed under GNU General Public License v2 5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text) 6 * (see COPYING for full license text)
7 */ 7 */
8 8
9#include "cgit.h"
10#include <time.h> 9#include <time.h>
11 10
11#include "cgit.h"
12#include "html.h"
12 13
13time_t read_agefile(char *path) 14time_t read_agefile(char *path)
14{ 15{
15 FILE *f; 16 FILE *f;
16 static char buf[64], buf2[64]; 17 static char buf[64], buf2[64];
17 18
18 if (!(f = fopen(path, "r"))) 19 if (!(f = fopen(path, "r")))
19 return -1; 20 return -1;
20 fgets(buf, sizeof(buf), f); 21 fgets(buf, sizeof(buf), f);
21 fclose(f); 22 fclose(f);
22 if (parse_date(buf, buf2, sizeof(buf2))) 23 if (parse_date(buf, buf2, sizeof(buf2)))
23 return strtoul(buf2, NULL, 10); 24 return strtoul(buf2, NULL, 10);
24 else 25 else
25 return 0; 26 return 0;
26} 27}
27 28
28static void print_modtime(struct cgit_repo *repo) 29static void print_modtime(struct cgit_repo *repo)
29{ 30{
30 char *path; 31 char *path;
31 struct stat s; 32 struct stat s;
32 33
33 path = fmt("%s/%s", repo->path, ctx.cfg.agefile); 34 path = fmt("%s/%s", repo->path, ctx.cfg.agefile);
34 if (stat(path, &s) == 0) { 35 if (stat(path, &s) == 0) {
35 cgit_print_age(read_agefile(path), -1, NULL); 36 cgit_print_age(read_agefile(path), -1, NULL);