author | Michael Krelin <hacker@klever.net> | 2007-07-21 11:13:40 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-21 11:13:40 (UTC) |
commit | 0df096f6e146187e55e2203ea1c017442cc2c8c6 (patch) (unidiff) | |
tree | c3daea456db5424bbddee326c1479a2b759d551a /ui-shared.c | |
parent | 86ca02231fc42a629c50abebcae3ea9d4d692979 (diff) | |
download | cgit-0df096f6e146187e55e2203ea1c017442cc2c8c6.zip cgit-0df096f6e146187e55e2203ea1c017442cc2c8c6.tar.gz cgit-0df096f6e146187e55e2203ea1c017442cc2c8c6.tar.bz2 |
added snapshot filename to the link
- changed cgit_pageurl into cgit_fileurl with the filename parameter
- rewritten cgit_pageurl as a wrapper around cgit_fileurl
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | ui-shared.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ui-shared.c b/ui-shared.c index d4376ce..1c1415e 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -58,11 +58,11 @@ char *cgit_repourl(const char *reponame) | |||
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, |
@@ -76,4 +76,11 @@ char *cgit_pageurl(const char *reponame, const char *pagename, | |||
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 | { |
@@ -369,2 +376,4 @@ void cgit_print_snapshot_start(const char *mimetype, const char *filename, | |||
369 | html("\n"); | 376 | html("\n"); |
370 | } | 377 | } |
378 | |||
379 | /* vim:set sw=8: */ | ||