mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
ui-shared: currenturl should take into account leading slash
This commit is contained in:
parent
438bac6f57
commit
8eef4589d0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user