Diffstat (limited to 'parsing.c')
| -rw-r--r-- | parsing.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -6,8 +6,6 @@ * (see COPYING for full license text) */ -#define USE_THE_REPOSITORY_VARIABLE - #include "cgit.h" /* @@ -19,7 +17,7 @@ */ void cgit_parse_url(const char *url) { - char *c, *cmd, *p, *buf; + char *c, *cmd, *p; struct cgit_repo *repo; if (!url || url[0] == '\0') @@ -32,12 +30,11 @@ void cgit_parse_url(const char *url) return; } - buf = xstrdup(url); cmd = NULL; - c = strchr(buf, '/'); + c = strchr(url, '/'); while (c) { c[0] = '\0'; - repo = cgit_get_repoinfo(buf); + repo = cgit_get_repoinfo(url); if (repo) { ctx.repo = repo; cmd = c; @@ -57,7 +54,6 @@ void cgit_parse_url(const char *url) if (cmd[1]) ctx.qry.page = xstrdup(cmd + 1); } - free(buf); } static char *substr(const char *head, const char *tail) @@ -202,7 +198,7 @@ struct taginfo *cgit_parse_tag(struct tag *tag) const char *p; struct taginfo *ret = NULL; - data = odb_read_object(the_repository->objects, &tag->object.oid, &type, &size); + data = read_object_file(&tag->object.oid, &type, &size); if (!data || type != OBJ_TAG) goto cleanup; |