aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui-shared.c4
-rw-r--r--ui-shared.h2
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)
return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
}
-const char *cgit_currenturl(void)
+char *cgit_currenturl(void)
{
if (!ctx.qry.url)
- return cgit_rooturl();
+ return xstrdup(cgit_rooturl());
const char *root = cgit_rooturl();
size_t len = strlen(root);
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 @@
extern const char *cgit_httpscheme();
extern const char *cgit_hosturl();
extern const char *cgit_rooturl();
-extern const char *cgit_currenturl();
+extern char *cgit_currenturl();
extern const char *cgit_loginurl();
extern char *cgit_repourl(const char *reponame);
extern char *cgit_fileurl(const char *reponame, const char *pagename,