diff options
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 4 |
1 files changed, 2 insertions, 2 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] == '/') |