|
diff --git a/cgit.c b/cgit.c index b3a98c1..dbec196 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -18,4 +18,12 @@ |
18 | const char *cgit_version = CGIT_VERSION; |
18 | const char *cgit_version = CGIT_VERSION; |
19 | |
19 | |
| |
20 | void add_mimetype(const char *name, const char *value) |
| |
21 | { |
| |
22 | struct string_list_item *item; |
| |
23 | |
| |
24 | item = string_list_insert(xstrdup(name), &ctx.cfg.mimetypes); |
| |
25 | item->util = xstrdup(value); |
| |
26 | } |
| |
27 | |
20 | struct cgit_filter *new_filter(const char *cmd, int extra_args) |
28 | struct cgit_filter *new_filter(const char *cmd, int extra_args) |
21 | { |
29 | { |
@@ -67,4 +75,6 @@ void config_cb(const char *name, const char *value) |
67 | } else if (!strcmp(name, "nocache")) |
75 | } else if (!strcmp(name, "nocache")) |
68 | ctx.cfg.nocache = atoi(value); |
76 | ctx.cfg.nocache = atoi(value); |
| |
77 | else if (!strcmp(name, "noplainemail")) |
| |
78 | ctx.cfg.noplainemail = atoi(value); |
69 | else if (!strcmp(name, "noheader")) |
79 | else if (!strcmp(name, "noheader")) |
70 | ctx.cfg.noheader = atoi(value); |
80 | ctx.cfg.noheader = atoi(value); |
@@ -121,4 +131,6 @@ void config_cb(const char *name, const char *value) |
121 | else if (!strcmp(name, "local-time")) |
131 | else if (!strcmp(name, "local-time")) |
122 | ctx.cfg.local_time = atoi(value); |
132 | ctx.cfg.local_time = atoi(value); |
| |
133 | else if (!prefixcmp(name, "mimetype.")) |
| |
134 | add_mimetype(name + 9, value); |
123 | else if (!strcmp(name, "repo.group")) |
135 | else if (!strcmp(name, "repo.group")) |
124 | ctx.cfg.repo_group = xstrdup(value); |
136 | ctx.cfg.repo_group = xstrdup(value); |
@@ -237,4 +249,5 @@ static void prepare_context(struct cgit_context *ctx) |
237 | ctx->page.expires = ctx->page.modified; |
249 | ctx->page.expires = ctx->page.modified; |
238 | ctx->page.etag = NULL; |
250 | ctx->page.etag = NULL; |
| |
251 | memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list)); |
239 | } |
252 | } |
240 | |
253 | |
|