diff options
author | Lars Hjemli | 2010-08-21 15:08:01 +0200 |
---|---|---|
committer | Lars Hjemli | 2010-08-22 13:35:47 +0200 |
commit | 515edb0da3b9156e07e269621d7474cdea82acaf (patch) | |
tree | e5fed5e83f29166c23216437386e10070e1d258d /cgit.c | |
parent | 6d7552bc072599313ef423d69156d824c075572a (diff) | |
download | cgit-515edb0da3b9156e07e269621d7474cdea82acaf.tar.gz cgit-515edb0da3b9156e07e269621d7474cdea82acaf.tar.bz2 cgit-515edb0da3b9156e07e269621d7474cdea82acaf.zip |
Add support for "readme" option
The value of this option is used as the default value for repo.readme.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.c')
-rw-r--r-- | cgit.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -72,11 +72,7 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *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); |
@@ -97,6 +93,8 @@ void config_cb(const char *name, const char *value) | |||
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")) |