|
diff --git a/cgit.c b/cgit.c index 8f154c9..8795085 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -4,48 +4,50 @@ |
4 | * |
4 | * |
5 | * Licensed under GNU General Public License v2 |
5 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) |
6 | * (see COPYING for full license text) |
7 | */ |
7 | */ |
8 | |
8 | |
9 | #include "cgit.h" |
9 | #include "cgit.h" |
10 | #include "cache.h" |
10 | #include "cache.h" |
11 | #include "cmd.h" |
11 | #include "cmd.h" |
12 | #include "configfile.h" |
12 | #include "configfile.h" |
13 | #include "html.h" |
13 | #include "html.h" |
14 | #include "ui-shared.h" |
14 | #include "ui-shared.h" |
15 | |
15 | |
16 | const char *cgit_version = CGIT_VERSION; |
16 | const char *cgit_version = CGIT_VERSION; |
17 | |
17 | |
18 | void config_cb(const char *name, const char *value) |
18 | void config_cb(const char *name, const char *value) |
19 | { |
19 | { |
20 | if (!strcmp(name, "root-title")) |
20 | if (!strcmp(name, "root-title")) |
21 | ctx.cfg.root_title = xstrdup(value); |
21 | ctx.cfg.root_title = xstrdup(value); |
22 | else if (!strcmp(name, "root-desc")) |
22 | else if (!strcmp(name, "root-desc")) |
23 | ctx.cfg.root_desc = xstrdup(value); |
23 | ctx.cfg.root_desc = xstrdup(value); |
24 | else if (!strcmp(name, "root-readme")) |
24 | else if (!strcmp(name, "root-readme")) |
25 | ctx.cfg.root_readme = xstrdup(value); |
25 | ctx.cfg.root_readme = xstrdup(value); |
26 | else if (!strcmp(name, "css")) |
26 | else if (!strcmp(name, "css")) |
27 | ctx.cfg.css = xstrdup(value); |
27 | ctx.cfg.css = xstrdup(value); |
| |
28 | else if (!strcmp(name, "favicon")) |
| |
29 | ctx.cfg.favicon = xstrdup(value); |
28 | else if (!strcmp(name, "footer")) |
30 | else if (!strcmp(name, "footer")) |
29 | ctx.cfg.footer = xstrdup(value); |
31 | ctx.cfg.footer = xstrdup(value); |
30 | else if (!strcmp(name, "logo")) |
32 | else if (!strcmp(name, "logo")) |
31 | ctx.cfg.logo = xstrdup(value); |
33 | ctx.cfg.logo = xstrdup(value); |
32 | else if (!strcmp(name, "index-header")) |
34 | else if (!strcmp(name, "index-header")) |
33 | ctx.cfg.index_header = xstrdup(value); |
35 | ctx.cfg.index_header = xstrdup(value); |
34 | else if (!strcmp(name, "index-info")) |
36 | else if (!strcmp(name, "index-info")) |
35 | ctx.cfg.index_info = xstrdup(value); |
37 | ctx.cfg.index_info = xstrdup(value); |
36 | else if (!strcmp(name, "logo-link")) |
38 | else if (!strcmp(name, "logo-link")) |
37 | ctx.cfg.logo_link = xstrdup(value); |
39 | ctx.cfg.logo_link = xstrdup(value); |
38 | else if (!strcmp(name, "module-link")) |
40 | else if (!strcmp(name, "module-link")) |
39 | ctx.cfg.module_link = xstrdup(value); |
41 | ctx.cfg.module_link = xstrdup(value); |
40 | else if (!strcmp(name, "virtual-root")) { |
42 | else if (!strcmp(name, "virtual-root")) { |
41 | ctx.cfg.virtual_root = trim_end(value, '/'); |
43 | ctx.cfg.virtual_root = trim_end(value, '/'); |
42 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) |
44 | if (!ctx.cfg.virtual_root && (!strcmp(value, "/"))) |
43 | ctx.cfg.virtual_root = ""; |
45 | ctx.cfg.virtual_root = ""; |
44 | } else if (!strcmp(name, "nocache")) |
46 | } else if (!strcmp(name, "nocache")) |
45 | ctx.cfg.nocache = atoi(value); |
47 | ctx.cfg.nocache = atoi(value); |
46 | else if (!strcmp(name, "snapshots")) |
48 | else if (!strcmp(name, "snapshots")) |
47 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); |
49 | ctx.cfg.snapshots = cgit_parse_snapshots_mask(value); |
48 | else if (!strcmp(name, "enable-index-links")) |
50 | else if (!strcmp(name, "enable-index-links")) |
49 | ctx.cfg.enable_index_links = atoi(value); |
51 | ctx.cfg.enable_index_links = atoi(value); |
50 | else if (!strcmp(name, "enable-log-filecount")) |
52 | else if (!strcmp(name, "enable-log-filecount")) |
51 | ctx.cfg.enable_log_filecount = atoi(value); |
53 | ctx.cfg.enable_log_filecount = atoi(value); |
|