about summary refs log tree commit diff
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 6211056..c7fbc5e 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -68,7 +68,10 @@ char *cgit_pageurl(const char *reponame, const char *pagename,
 			return fmt("%s/%s/%s/", cgit_virtual_root, reponame,
 				   pagename);
 	} else {
-		return fmt("?r=%s&p=%s&%s", reponame, pagename, query);
+		if (query)
+			return fmt("?r=%s&p=%s&%s", reponame, pagename, query);
+		else
+			return fmt("?r=%s&p=%s", reponame, pagename);
 	}
 }