diff options
author | Christian Hesse | 2015-10-09 13:15:47 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2015-10-09 14:00:56 +0200 |
commit | c5c0eb873e0b9e40ffc3e85b621310ee85059ceb (patch) | |
tree | 06a3a6e14a805de318635166912e8c3a1cc7c7ec | |
parent | 37fce9916a264e23c0639df56ca3ecbbdc1c84b8 (diff) | |
download | cgit-c5c0eb873e0b9e40ffc3e85b621310ee85059ceb.tar.gz cgit-c5c0eb873e0b9e40ffc3e85b621310ee85059ceb.tar.bz2 cgit-c5c0eb873e0b9e40ffc3e85b621310ee85059ceb.zip |
ui-shared: return value of cgit_currenturl is not const
Signed-off-by: Christian Hesse <mail@eworm.de>
-rw-r--r-- | ui-shared.c | 4 | ||||
-rw-r--r-- | ui-shared.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ui-shared.c b/ui-shared.c index d9f8258..b739675 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -65,10 +65,10 @@ const char *cgit_hosturl(void) | |||
65 | return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); | 65 | return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port); |
66 | } | 66 | } |
67 | 67 | ||
68 | const char *cgit_currenturl(void) | 68 | char *cgit_currenturl(void) |
69 | { | 69 | { |
70 | if (!ctx.qry.url) | 70 | if (!ctx.qry.url) |
71 | return cgit_rooturl(); | 71 | return xstrdup(cgit_rooturl()); |
72 | const char *root = cgit_rooturl(); | 72 | const char *root = cgit_rooturl(); |
73 | size_t len = strlen(root); | 73 | size_t len = strlen(root); |
74 | if (len && root[len - 1] == '/') | 74 | if (len && root[len - 1] == '/') |
diff --git a/ui-shared.h b/ui-shared.h index 246678b..4121416 100644 --- a/ui-shared.h +++ b/ui-shared.h | |||
@@ -4,7 +4,7 @@ | |||
4 | extern const char *cgit_httpscheme(); | 4 | extern const char *cgit_httpscheme(); |
5 | extern const char *cgit_hosturl(); | 5 | extern const char *cgit_hosturl(); |
6 | extern const char *cgit_rooturl(); | 6 | extern const char *cgit_rooturl(); |
7 | extern const char *cgit_currenturl(); | 7 | extern char *cgit_currenturl(); |
8 | extern const char *cgit_loginurl(); | 8 | extern const char *cgit_loginurl(); |
9 | extern char *cgit_repourl(const char *reponame); | 9 | extern char *cgit_repourl(const char *reponame); |
10 | extern char *cgit_fileurl(const char *reponame, const char *pagename, | 10 | extern char *cgit_fileurl(const char *reponame, const char *pagename, |