commit 5e08262609e4b99fae21c63ff12d7c9cbfc981e2 from: Stefan Sperling date: Thu Sep 24 10:51:21 2020 UTC remove redundant leading slashes from repository path parsed from got.conf commit - 0921e08fd73a69dae201e11e6feaf9227be19285 commit + 5e08262609e4b99fae21c63ff12d7c9cbfc981e2 blob - 159d313029b27ad7096bea05e36085f057e5a051 blob + e7234d40124938d4a98b3294599098e47661c6f5 --- libexec/got-read-gotconfig/got-read-gotconfig.c +++ libexec/got-read-gotconfig/got-read-gotconfig.c @@ -32,6 +32,7 @@ #include "got_error.h" #include "got_object.h" +#include "got_path.h" #include "got_repository.h" #include "got_lib_delta.h" @@ -83,15 +84,20 @@ make_repo_url(char **url, struct gotconfig_remote_repo } if (repo->repository) { + char *repo_path = repo->repository; + while (repo_path[0] == '/') + repo_path++; p = s; s = NULL; - if (asprintf(&s, "%s/%s", p, repo->repository) == -1) { + if (asprintf(&s, "%s/%s", p, repo_path) == -1) { err = got_error_from_errno("asprintf"); goto done; } free(p); p = NULL; } + + got_path_strip_trailing_slashes(s); done: if (err) { free(s);