|
diff --git a/cgit.c b/cgit.c index eff5b7a..4f2c752 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -1,11 +1,12 @@ |
1 | /* cgit.c: cgi for the git scm |
1 | /* cgit.c: cgi for the git scm |
2 | * |
2 | * |
3 | * Copyright (C) 2006 Lars Hjemli |
3 | * Copyright (C) 2006 Lars Hjemli |
| |
4 | * Copyright (C) 2010 Jason A. Donenfeld <Jason@zx2c4.com> |
4 | * |
5 | * |
5 | * Licensed under GNU General Public License v2 |
6 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) |
7 | * (see COPYING for full license text) |
7 | */ |
8 | */ |
8 | |
9 | |
9 | #include "cgit.h" |
10 | #include "cgit.h" |
10 | #include "cache.h" |
11 | #include "cache.h" |
11 | #include "cmd.h" |
12 | #include "cmd.h" |
@@ -66,17 +67,18 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) |
66 | repo->enable_subject_links = atoi(value); |
67 | repo->enable_subject_links = atoi(value); |
67 | else if (!strcmp(name, "max-stats")) |
68 | else if (!strcmp(name, "max-stats")) |
68 | repo->max_stats = cgit_find_stats_period(value, NULL); |
69 | repo->max_stats = cgit_find_stats_period(value, NULL); |
69 | else if (!strcmp(name, "module-link")) |
70 | else if (!strcmp(name, "module-link")) |
70 | repo->module_link= xstrdup(value); |
71 | repo->module_link= xstrdup(value); |
71 | else if (!strcmp(name, "section")) |
72 | else if (!strcmp(name, "section")) |
72 | repo->section = xstrdup(value); |
73 | repo->section = xstrdup(value); |
73 | else if (!strcmp(name, "readme") && value != NULL) { |
74 | else if (!strcmp(name, "readme") && value != NULL) { |
74 | if (*value == '/') |
75 | char *colon; |
| |
76 | if (*value == '/' || ((colon = strchr(value, ':')) != NULL && colon != value && *(colon + 1) != '\0')) |
75 | repo->readme = xstrdup(value); |
77 | repo->readme = xstrdup(value); |
76 | else |
78 | else |
77 | repo->readme = xstrdup(fmt("%s/%s", repo->path, value)); |
79 | repo->readme = xstrdup(fmt("%s/%s", repo->path, value)); |
78 | } else if (ctx.cfg.enable_filter_overrides) { |
80 | } else if (ctx.cfg.enable_filter_overrides) { |
79 | if (!strcmp(name, "about-filter")) |
81 | if (!strcmp(name, "about-filter")) |
80 | repo->about_filter = new_filter(value, 0); |
82 | repo->about_filter = new_filter(value, 0); |
81 | else if (!strcmp(name, "commit-filter")) |
83 | else if (!strcmp(name, "commit-filter")) |
82 | repo->commit_filter = new_filter(value, 0); |
84 | repo->commit_filter = new_filter(value, 0); |
|