summaryrefslogtreecommitdiffabout
path: root/cgit.c
Unidiff
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index ff678fb..4f68a4b 100644
--- a/cgit.c
+++ b/cgit.c
@@ -68,9 +68,9 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
68 repo->section = xstrdup(value); 68 repo->section = xstrdup(value);
69 else if (!strcmp(name, "readme") && value != NULL) { 69 else if (!strcmp(name, "readme") && value != NULL) {
70 if (*value == '/') 70 if (*value == '/')
71 ctx.repo->readme = xstrdup(value); 71 repo->readme = xstrdup(value);
72 else 72 else
73 ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); 73 repo->readme = xstrdup(fmt("%s/%s", repo->path, value));
74 } else if (ctx.cfg.enable_filter_overrides) { 74 } else if (ctx.cfg.enable_filter_overrides) {
75 if (!strcmp(name, "about-filter")) 75 if (!strcmp(name, "about-filter"))
76 repo->about_filter = new_filter(value, 0); 76 repo->about_filter = new_filter(value, 0);
@@ -165,6 +165,8 @@ void config_cb(const char *name, const char *value)
165 ctx.cfg.max_msg_len = atoi(value); 165 ctx.cfg.max_msg_len = atoi(value);
166 else if (!strcmp(name, "max-repodesc-length")) 166 else if (!strcmp(name, "max-repodesc-length"))
167 ctx.cfg.max_repodesc_len = atoi(value); 167 ctx.cfg.max_repodesc_len = atoi(value);
168 else if (!strcmp(name, "max-blob-size"))
169 ctx.cfg.max_blob_size = atoi(value);
168 else if (!strcmp(name, "max-repo-count")) 170 else if (!strcmp(name, "max-repo-count"))
169 ctx.cfg.max_repo_count = atoi(value); 171 ctx.cfg.max_repo_count = atoi(value);
170 else if (!strcmp(name, "max-commit-count")) 172 else if (!strcmp(name, "max-commit-count"))
@@ -211,6 +213,8 @@ static void querystring_cb(const char *name, const char *value)
211 } else if (!strcmp(name, "p")) { 213 } else if (!strcmp(name, "p")) {
212 ctx.qry.page = xstrdup(value); 214 ctx.qry.page = xstrdup(value);
213 } else if (!strcmp(name, "url")) { 215 } else if (!strcmp(name, "url")) {
216 if (*value == '/')
217 value++;
214 ctx.qry.url = xstrdup(value); 218 ctx.qry.url = xstrdup(value);
215 cgit_parse_url(value); 219 cgit_parse_url(value);
216 } else if (!strcmp(name, "qt")) { 220 } else if (!strcmp(name, "qt")) {
@@ -272,6 +276,7 @@ static void prepare_context(struct cgit_context *ctx)
272 ctx->cfg.max_lock_attempts = 5; 276 ctx->cfg.max_lock_attempts = 5;
273 ctx->cfg.max_msg_len = 80; 277 ctx->cfg.max_msg_len = 80;
274 ctx->cfg.max_repodesc_len = 80; 278 ctx->cfg.max_repodesc_len = 80;
279 ctx->cfg.max_blob_size = 0;
275 ctx->cfg.max_stats = 0; 280 ctx->cfg.max_stats = 0;
276 ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; 281 ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s";
277 ctx->cfg.renamelimit = -1; 282 ctx->cfg.renamelimit = -1;