diff options
-rw-r--r-- | cgit.h | 2 | ||||
-rw-r--r-- | ui-shared.c | 17 | ||||
-rw-r--r-- | ui-snapshot.c | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/cgit.h b/cgit.h index 6937c42..aabf725 100644 --- a/cgit.h +++ b/cgit.h | |||
@@ -201,6 +201,8 @@ extern int cache_exist(struct cacheitem *item); | |||
201 | extern int cache_expired(struct cacheitem *item); | 201 | extern int cache_expired(struct cacheitem *item); |
202 | 202 | ||
203 | extern char *cgit_repourl(const char *reponame); | 203 | extern char *cgit_repourl(const char *reponame); |
204 | extern char *cgit_fileurl(const char *reponame, const char *pagename, | ||
205 | const char *filename, const char *query); | ||
204 | extern char *cgit_pageurl(const char *reponame, const char *pagename, | 206 | extern char *cgit_pageurl(const char *reponame, const char *pagename, |
205 | const char *query); | 207 | const char *query); |
206 | 208 | ||
diff --git a/ui-shared.c b/ui-shared.c index d4376ce..1c1415e 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -57,13 +57,13 @@ char *cgit_repourl(const char *reponame) | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | char *cgit_pageurl(const char *reponame, const char *pagename, | 60 | char *cgit_fileurl(const char *reponame, const char *pagename, |
61 | const char *query) | 61 | const char *filename, const char *query) |
62 | { | 62 | { |
63 | if (cgit_virtual_root) { | 63 | if (cgit_virtual_root) { |
64 | if (query) | 64 | if (query) |
65 | return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame, | 65 | return fmt("%s/%s/%s/%s?%s", cgit_virtual_root, reponame, |
66 | pagename, query); | 66 | pagename, filename?filename:"", query); |
67 | else | 67 | else |
68 | return fmt("%s/%s/%s/", cgit_virtual_root, reponame, | 68 | return fmt("%s/%s/%s/", cgit_virtual_root, reponame, |
69 | pagename); | 69 | pagename); |
@@ -75,6 +75,13 @@ char *cgit_pageurl(const char *reponame, const char *pagename, | |||
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | char *cgit_pageurl(const char *reponame, const char *pagename, | ||
79 | const char *query) | ||
80 | { | ||
81 | return cgit_fileurl(reponame,pagename,0,query); | ||
82 | } | ||
83 | |||
84 | |||
78 | char *cgit_currurl() | 85 | char *cgit_currurl() |
79 | { | 86 | { |
80 | if (!cgit_virtual_root) | 87 | if (!cgit_virtual_root) |
@@ -368,3 +375,5 @@ void cgit_print_snapshot_start(const char *mimetype, const char *filename, | |||
368 | ttl_seconds(item->ttl))); | 375 | ttl_seconds(item->ttl))); |
369 | html("\n"); | 376 | html("\n"); |
370 | } | 377 | } |
378 | |||
379 | /* vim:set sw=8: */ | ||
diff --git a/ui-snapshot.c b/ui-snapshot.c index 84bf8f7..7076b50 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c | |||
@@ -109,7 +109,7 @@ void cgit_print_snapshot_links(const char *repo,const char *hex) | |||
109 | const struct snapshot_archive_t* sat = &snapshot_archives[f]; | 109 | const struct snapshot_archive_t* sat = &snapshot_archives[f]; |
110 | filename = fmt("%s-%s%s",repo,hex,sat->suffix); | 110 | filename = fmt("%s-%s%s",repo,hex,sat->suffix); |
111 | htmlf("<a href='%s'>%s</a><br/>", | 111 | htmlf("<a href='%s'>%s</a><br/>", |
112 | cgit_pageurl(repo,"snapshot", | 112 | cgit_fileurl(repo,"snapshot",filename, |
113 | fmt("id=%s&name=%s",hex,filename)), filename); | 113 | fmt("id=%s&name=%s",hex,filename)), filename); |
114 | } | 114 | } |
115 | } | 115 | } |