-rw-r--r-- | cgit.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -69,7 +69,7 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) else if (!strcmp(name, "readme") && value != NULL) { if (*value == '/') - ctx.repo->readme = xstrdup(value); + repo->readme = xstrdup(value); else - ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); + repo->readme = xstrdup(fmt("%s/%s", repo->path, value)); } else if (ctx.cfg.enable_filter_overrides) { if (!strcmp(name, "about-filter")) @@ -166,4 +166,6 @@ void config_cb(const char *name, const char *value) else if (!strcmp(name, "max-repodesc-length")) ctx.cfg.max_repodesc_len = atoi(value); + else if (!strcmp(name, "max-blob-size")) + ctx.cfg.max_blob_size = atoi(value); else if (!strcmp(name, "max-repo-count")) ctx.cfg.max_repo_count = atoi(value); @@ -212,4 +214,6 @@ static void querystring_cb(const char *name, const char *value) ctx.qry.page = xstrdup(value); } else if (!strcmp(name, "url")) { + if (*value == '/') + value++; ctx.qry.url = xstrdup(value); cgit_parse_url(value); @@ -273,4 +277,5 @@ static void prepare_context(struct cgit_context *ctx) ctx->cfg.max_msg_len = 80; ctx->cfg.max_repodesc_len = 80; + ctx->cfg.max_blob_size = 0; ctx->cfg.max_stats = 0; ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |