Diffstat (limited to 'cgit.c')
| -rw-r--r-- | cgit.c | 28 |
1 files changed, 6 insertions, 22 deletions
@@ -29,17 +29,15 @@ void add_mimetype(const char *name, const char *value) struct cgit_filter *new_filter(const char *cmd, int extra_args) { struct cgit_filter *f; - int args_size = 0; if (!cmd || !cmd[0]) return NULL; f = xmalloc(sizeof(struct cgit_filter)); f->cmd = xstrdup(cmd); - args_size = (2 + extra_args) * sizeof(char *); - f->argv = xmalloc(args_size); - memset(f->argv, 0, args_size); + f->argv = xmalloc((2 + extra_args) * sizeof(char *)); f->argv[0] = f->cmd; + f->argv[1] = NULL; return f; } @@ -59,8 +57,6 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) repo->defbranch = xstrdup(value); else if (!strcmp(name, "snapshots")) repo->snapshots = ctx.cfg.snapshots & cgit_parse_snapshots_mask(value); - else if (!strcmp(name, "enable-commit-graph")) - repo->enable_commit_graph = ctx.cfg.enable_commit_graph * atoi(value); else if (!strcmp(name, "enable-log-filecount")) repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); else if (!strcmp(name, "enable-log-linecount")) @@ -75,13 +71,9 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value) repo->module_link= xstrdup(value); else if (!strcmp(name, "section")) repo->section = xstrdup(value); - else if (!strcmp(name, "readme") && value != NULL) + else if (!strcmp(name, "readme") && value != NULL) { repo->readme = xstrdup(value); - else if (!strcmp(name, "logo") && value != NULL) - repo->logo = xstrdup(value); - else if (!strcmp(name, "logo-link") && value != NULL) - repo->logo_link = xstrdup(value); - else if (ctx.cfg.enable_filter_overrides) { + } else if (ctx.cfg.enable_filter_overrides) { if (!strcmp(name, "about-filter")) repo->about_filter = new_filter(value, 0); else if (!strcmp(name, "commit-filter")) @@ -151,8 +143,6 @@ void config_cb(const char *name, const char *value) ctx.cfg.enable_http_clone = atoi(value); else if (!strcmp(name, "enable-index-links")) ctx.cfg.enable_index_links = atoi(value); - else if (!strcmp(name, "enable-commit-graph")) - ctx.cfg.enable_commit_graph = atoi(value); else if (!strcmp(name, "enable-log-filecount")) ctx.cfg.enable_log_filecount = atoi(value); else if (!strcmp(name, "enable-log-linecount")) @@ -207,8 +197,6 @@ 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, "scan-hidden-path")) - ctx.cfg.scan_hidden_path = atoi(value); else if (!strcmp(name, "section-from-path")) ctx.cfg.section_from_path = atoi(value); else if (!strcmp(name, "source-filter")) @@ -330,7 +318,6 @@ static void prepare_context(struct cgit_context *ctx) ctx->cfg.robots = "index, nofollow"; ctx->cfg.root_title = "Git repository browser"; ctx->cfg.root_desc = "a fast webinterface for the git dscm"; - ctx->cfg.scan_hidden_path = 0; ctx->cfg.script_name = CGIT_SCRIPT_NAME; ctx->cfg.section = ""; ctx->cfg.summary_branches = 10; @@ -563,8 +550,6 @@ void print_repo(FILE *f, struct cgit_repo *repo) fprintf(f, "repo.section=%s\n", repo->section); if (repo->clone_url) fprintf(f, "repo.clone-url=%s\n", repo->clone_url); - fprintf(f, "repo.enable-commit-graph=%d\n", - repo->enable_commit_graph); fprintf(f, "repo.enable-log-filecount=%d\n", repo->enable_log_filecount); fprintf(f, "repo.enable-log-linecount=%d\n", @@ -764,11 +749,10 @@ int main(int argc, const char **argv) http_parse_querystring(ctx.qry.raw, querystring_cb); /* If virtual-root isn't specified in cgitrc, lets pretend - * that virtual-root equals SCRIPT_NAME, minus any possibly - * trailing slashes. + * that virtual-root equals SCRIPT_NAME. */ if (!ctx.cfg.virtual_root) - ctx.cfg.virtual_root = trim_end(ctx.cfg.script_name, '/'); + ctx.cfg.virtual_root = ctx.cfg.script_name; /* If no url parameter is specified on the querystring, lets * use PATH_INFO as url. This allows cgit to work with virtual |