diff options
| author | Jason A. Donenfeld <Jason@zx2c4.com> | 2026-05-05 00:03:22 +0300 |
|---|---|---|
| committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2026-05-05 00:03:51 +0300 |
| commit | 5a0f900569f421422bd7511a45c7346c7668e710 (patch) | |
| tree | 111f377a9925e7ba5dcc39c10d691c9a240b8114 /parsing.c | |
| parent | 44ca1d1ec8eee7f4440fbfd613fc1072a14b441c (diff) | |
global: fix libc constness warnings
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'parsing.c')
| -rw-r--r-- | parsing.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -19,7 +19,7 @@ */ void cgit_parse_url(const char *url) { - char *c, *cmd, *p; + char *c, *cmd, *p, *buf; struct cgit_repo *repo; if (!url || url[0] == '\0') @@ -32,11 +32,12 @@ void cgit_parse_url(const char *url) return; } + buf = xstrdup(url); cmd = NULL; - c = strchr(url, '/'); + c = strchr(buf, '/'); while (c) { c[0] = '\0'; - repo = cgit_get_repoinfo(url); + repo = cgit_get_repoinfo(buf); if (repo) { ctx.repo = repo; cmd = c; @@ -56,6 +57,7 @@ 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) |
