|
diff --git a/cgit.c b/cgit.c index d6146e2..04cef23 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -69,17 +69,13 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) |
69 | repo->max_stats = cgit_find_stats_period(value, NULL); |
69 | repo->max_stats = cgit_find_stats_period(value, NULL); |
70 | else if (!strcmp(name, "module-link")) |
70 | else if (!strcmp(name, "module-link")) |
71 | repo->module_link= xstrdup(value); |
71 | repo->module_link= xstrdup(value); |
72 | else if (!strcmp(name, "section")) |
72 | else if (!strcmp(name, "section")) |
73 | repo->section = xstrdup(value); |
73 | repo->section = xstrdup(value); |
74 | else if (!strcmp(name, "readme") && value != NULL) { |
74 | else if (!strcmp(name, "readme") && value != NULL) { |
75 | char *colon; |
75 | repo->readme = xstrdup(value); |
76 | if (*value == '/' || ((colon = strchr(value, ':')) != NULL && colon != value && *(colon + 1) != '\0')) |
| |
77 | repo->readme = xstrdup(value); |
| |
78 | else |
| |
79 | repo->readme = xstrdup(fmt("%s/%s", repo->path, value)); |
| |
80 | } else if (ctx.cfg.enable_filter_overrides) { |
76 | } else if (ctx.cfg.enable_filter_overrides) { |
81 | if (!strcmp(name, "about-filter")) |
77 | if (!strcmp(name, "about-filter")) |
82 | repo->about_filter = new_filter(value, 0); |
78 | repo->about_filter = new_filter(value, 0); |
83 | else if (!strcmp(name, "commit-filter")) |
79 | else if (!strcmp(name, "commit-filter")) |
84 | repo->commit_filter = new_filter(value, 0); |
80 | repo->commit_filter = new_filter(value, 0); |
85 | else if (!strcmp(name, "source-filter")) |
81 | else if (!strcmp(name, "source-filter")) |
@@ -94,12 +90,14 @@ void config_cb(const char *name, const char *value) |
94 | else if (!strcmp(name, "repo.url")) |
90 | else if (!strcmp(name, "repo.url")) |
95 | ctx.repo = cgit_add_repo(value); |
91 | ctx.repo = cgit_add_repo(value); |
96 | else if (ctx.repo && !strcmp(name, "repo.path")) |
92 | else if (ctx.repo && !strcmp(name, "repo.path")) |
97 | ctx.repo->path = trim_end(value, '/'); |
93 | ctx.repo->path = trim_end(value, '/'); |
98 | else if (ctx.repo && !prefixcmp(name, "repo.")) |
94 | else if (ctx.repo && !prefixcmp(name, "repo.")) |
99 | repo_config(ctx.repo, name + 5, value); |
95 | repo_config(ctx.repo, name + 5, value); |
| |
96 | else if (!strcmp(name, "readme")) |
| |
97 | ctx.cfg.readme = xstrdup(value); |
100 | else if (!strcmp(name, "root-title")) |
98 | else if (!strcmp(name, "root-title")) |
101 | ctx.cfg.root_title = xstrdup(value); |
99 | ctx.cfg.root_title = xstrdup(value); |
102 | else if (!strcmp(name, "root-desc")) |
100 | else if (!strcmp(name, "root-desc")) |
103 | ctx.cfg.root_desc = xstrdup(value); |
101 | ctx.cfg.root_desc = xstrdup(value); |
104 | else if (!strcmp(name, "root-readme")) |
102 | else if (!strcmp(name, "root-readme")) |
105 | ctx.cfg.root_readme = xstrdup(value); |
103 | ctx.cfg.root_readme = xstrdup(value); |
|