Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.zx2c4.com/cgit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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)
{
if (!ctx.qry.url)
return cgit_rooturl();
- return ctx.qry.url;
+ const char *root = cgit_rooturl();
+ size_t len = strlen(root);
+ if (len && root[len - 1] == '/')
+ return fmtalloc("%s%s", root, ctx.qry.url);
+ return fmtalloc("%s/%s", root, ctx.qry.url);
}
const char *cgit_rooturl(void)