]> git.cameronkatri.com Git - cgit.git/blobdiff - cgit.c
Add support for 'section-from-path' option
[cgit.git] / cgit.c
diff --git a/cgit.c b/cgit.c
index 4f2c752fd0d2f88bfa9f0b05e672588e3adfd99a..5666875d21509b90eb3659ccfbbce3b3db7d5a90 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -22,7 +22,7 @@ void add_mimetype(const char *name, const char *value)
 {
        struct string_list_item *item;
 
-       item = string_list_insert(xstrdup(name), &ctx.cfg.mimetypes);
+       item = string_list_insert(&ctx.cfg.mimetypes, xstrdup(name));
        item->util = xstrdup(value);
 }
 
@@ -195,6 +195,8 @@ void config_cb(const char *name, const char *value)
                                      ctx.cfg.project_list, repo_config);
                else
                        scan_tree(expand_macros(value), repo_config);
+       else if (!strcmp(name, "section-from-path"))
+               ctx.cfg.section_from_path = atoi(value);
        else if (!strcmp(name, "source-filter"))
                ctx.cfg.source_filter = new_filter(value, 1);
        else if (!strcmp(name, "summary-log"))