|
diff --git a/cgit.c b/cgit.c index 2039ab1..4f414c3 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 | void config_cb(const char *name, const char *value) |
28 | void config_cb(const char *name, const char *value) |
21 | { |
29 | { |
@@ -102,4 +110,6 @@ void config_cb(const char *name, const char *value) |
102 | else if (!strcmp(name, "local-time")) |
110 | else if (!strcmp(name, "local-time")) |
103 | ctx.cfg.local_time = atoi(value); |
111 | ctx.cfg.local_time = atoi(value); |
| |
112 | else if (!prefixcmp(name, "mimetype.")) |
| |
113 | add_mimetype(name + 9, value); |
104 | else if (!strcmp(name, "repo.group")) |
114 | else if (!strcmp(name, "repo.group")) |
105 | ctx.cfg.repo_group = xstrdup(value); |
115 | ctx.cfg.repo_group = xstrdup(value); |
@@ -214,4 +224,5 @@ static void prepare_context(struct cgit_context *ctx) |
214 | ctx->page.expires = ctx->page.modified; |
224 | ctx->page.expires = ctx->page.modified; |
215 | ctx->page.etag = NULL; |
225 | ctx->page.etag = NULL; |
| |
226 | memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list)); |
216 | } |
227 | } |
217 | |
228 | |
|