aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 7bcb8d3..23a893b 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -69,7 +69,11 @@ const char *cgit_currenturl(void)
69{ 69{
70 if (!ctx.qry.url) 70 if (!ctx.qry.url)
71 return cgit_rooturl(); 71 return cgit_rooturl();
72 return ctx.qry.url; 72 const char *root = cgit_rooturl();
73 size_t len = strlen(root);
74 if (len && root[len - 1] == '/')
75 return fmtalloc("%s%s", root, ctx.qry.url);
76 return fmtalloc("%s/%s", root, ctx.qry.url);
73} 77}
74 78
75const char *cgit_rooturl(void) 79const char *cgit_rooturl(void)