From 8eef4589d0ba80fd4e6a9ce2f3ca4fcf266a64e0 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 8 Mar 2015 12:34:07 +0100 Subject: ui-shared: currenturl should take into account leading slash --- ui-shared.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit 1.4.1 tion> dontfiles
summary refs log tree commit diff
path: root/bin/Makefile (unfollow)
Commit message (Expand)Author
2019-02-17Simplify temp trap in upJune McEnroe
2019-02-17Add line numbers to hiJune McEnroe
2019-02-17Always split spans after newlinesJune McEnroe
2019-02-15Color format specifiers light cyan in vimJune McEnroe
2019-02-15Highlight Interp as yellowJune McEnroe
2019-02-15Highlight strings in sh command substitutionsJune McEnroe
2019-02-15Add nmap gpJune McEnroe
2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe
2019-02-13Add forgotten "sixth" book of H2G2June McEnroe