-rw-r--r-- | cgit.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -19,2 +19,10 @@ const char *cgit_version = CGIT_VERSION; +void add_mimetype(const char *name, const char *value) +{ + struct string_list_item *item; + + item = string_list_insert(xstrdup(name), &ctx.cfg.mimetypes); + item->util = xstrdup(value); +} + void config_cb(const char *name, const char *value) @@ -105,2 +113,4 @@ void config_cb(const char *name, const char *value) ctx.cfg.local_time = atoi(value); + else if (!prefixcmp(name, "mimetype.")) + add_mimetype(name + 9, value); else if (!strcmp(name, "repo.group")) @@ -217,2 +227,3 @@ static void prepare_context(struct cgit_context *ctx) ctx->page.etag = NULL; + memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list)); } |