diff options
author | Lars Hjemli | 2007-05-16 02:06:28 +0200 |
---|---|---|
committer | Lars Hjemli | 2007-05-16 02:06:28 +0200 |
commit | 723469962b42de9f73960a883403cfdc422f176f (patch) | |
tree | 6f0090acb7ba5f79524197ec2e8419c8556d8fac | |
parent | 97de8f0554649544c78aeb35a4c3431f17667ec5 (diff) | |
download | cgit-723469962b42de9f73960a883403cfdc422f176f.tar.gz cgit-723469962b42de9f73960a883403cfdc422f176f.tar.bz2 cgit-723469962b42de9f73960a883403cfdc422f176f.zip |
Make git_pageurl handle NULL querystrings
This is suddenly useful after the repo.defbranch-related changes.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-shared.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c index b0cff7d..6211056 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -61,8 +61,12 @@ char *cgit_pageurl(const char *reponame, const char *pagename, | |||
61 | const char *query) | 61 | const char *query) |
62 | { | 62 | { |
63 | if (cgit_virtual_root) { | 63 | if (cgit_virtual_root) { |
64 | return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame, | 64 | if (query) |
65 | pagename, query); | 65 | return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame, |
66 | pagename, query); | ||
67 | else | ||
68 | return fmt("%s/%s/%s/", cgit_virtual_root, reponame, | ||
69 | pagename); | ||
66 | } else { | 70 | } else { |
67 | return fmt("?r=%s&p=%s&%s", reponame, pagename, query); | 71 | return fmt("?r=%s&p=%s&%s", reponame, pagename, query); |
68 | } | 72 | } |