-rw-r--r-- | parsing.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -145,3 +145,3 @@ void cgit_parse_url(const char *url) - cgit_repo = NULL; + ctx.repo = NULL; if (!url || url[0] == '\0') @@ -149,5 +149,5 @@ void cgit_parse_url(const char *url) - cgit_repo = cgit_get_repoinfo(url); - if (cgit_repo) { - ctx.qry.repo = cgit_repo->url; + ctx.repo = cgit_get_repoinfo(url); + if (ctx.repo) { + ctx.qry.repo = ctx.repo->url; return; @@ -156,6 +156,6 @@ void cgit_parse_url(const char *url) cmd = strchr(url, '/'); - while (!cgit_repo && cmd) { + while (!ctx.repo && cmd) { cmd[0] = '\0'; - cgit_repo = cgit_get_repoinfo(url); - if (cgit_repo == NULL) { + ctx.repo = cgit_get_repoinfo(url); + if (ctx.repo == NULL) { cmd[0] = '/'; @@ -165,3 +165,3 @@ void cgit_parse_url(const char *url) - ctx.qry.repo = cgit_repo->url; + ctx.qry.repo = ctx.repo->url; p = strchr(cmd + 1, '/'); |