-rw-r--r-- | shared.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -107,9 +107,9 @@ struct repoinfo *add_repo(const char *url) sizeof(struct repoinfo)); } ret = &cgit_repolist.repos[cgit_repolist.count-1]; - ret->url = xstrdup(url); + ret->url = trim_end(url, '/'); ret->name = ret->url; ret->path = NULL; ret->desc = NULL; ret->owner = NULL; @@ -150,9 +150,9 @@ void cgit_global_config_cb(const char *name, const char *value) cgit_logo_link = xstrdup(value); else if (!strcmp(name, "module-link")) cgit_module_link = xstrdup(value); else if (!strcmp(name, "virtual-root")) - cgit_virtual_root = xstrdup(value); + cgit_virtual_root = trim_end(value, '/'); else if (!strcmp(name, "nocache")) cgit_nocache = atoi(value); else if (!strcmp(name, "snapshots")) cgit_snapshots = cgit_parse_snapshots_mask(value); @@ -188,9 +188,9 @@ void cgit_global_config_cb(const char *name, const char *value) cgit_repo = add_repo(value); else if (!strcmp(name, "repo.name")) cgit_repo->name = xstrdup(value); else if (cgit_repo && !strcmp(name, "repo.path")) - cgit_repo->path = xstrdup(value); + cgit_repo->path = trim_end(value, '/'); else if (cgit_repo && !strcmp(name, "repo.desc")) cgit_repo->desc = xstrdup(value); else if (cgit_repo && !strcmp(name, "repo.owner")) cgit_repo->owner = xstrdup(value); |