aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--filter.c2
-rw-r--r--parsing.c8
-rw-r--r--shared.c3
-rw-r--r--ui-blame.c2
-rw-r--r--ui-plain.c2
5 files changed, 7 insertions, 10 deletions
diff --git a/filter.c b/filter.c
index c778d05..cb01d32 100644
--- a/filter.c
+++ b/filter.c
@@ -402,7 +402,7 @@ static const struct {
struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype)
{
- const char *colon;
+ char *colon;
int i;
size_t len;
int argument_count;
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)
diff --git a/shared.c b/shared.c
index a39394d..8173eb8 100644
--- a/shared.c
+++ b/shared.c
@@ -551,8 +551,7 @@ char *expand_macros(const char *txt)
char *get_mimetype_for_filename(const char *filename)
{
- const char *ext;
- char *mimetype, line[1024];
+ char *ext, *mimetype, line[1024];
struct string_list list = STRING_LIST_INIT_NODUP;
int i;
FILE *file;
diff --git a/ui-blame.c b/ui-blame.c
index 5c6f36e..9c575ef 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -263,7 +263,7 @@ static int walk_tree(const struct object_id *oid, struct strbuf *base,
static int basedir_len(const char *path)
{
- const char *p = strrchr(path, '/');
+ char *p = strrchr(path, '/');
if (p)
return p - path + 1;
return 0;
diff --git a/ui-plain.c b/ui-plain.c
index a2a4087..0301439 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -157,7 +157,7 @@ static int walk_tree(const struct object_id *oid, struct strbuf *base,
static int basedir_len(const char *path)
{
- const char *p = strrchr(path, '/');
+ char *p = strrchr(path, '/');
if (p)
return p - path + 1;
return 0;