aboutsummaryrefslogtreecommitdiff
path: root/parsing.c
diff refs
from:
to:
flip
diff options
context:
space:
mode:
Diffstat (limited to 'parsing.c')
-rw-r--r--parsing.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/parsing.c b/parsing.c
index bdaed25..115ce81 100644
--- a/parsing.c
+++ b/parsing.c
@@ -19,7 +19,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 +32,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 +56,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)