author | Ondrej Jirman <ondrej.jirman@zonio.net> | 2007-05-25 23:15:10 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-31 08:18:38 (UTC) |
commit | 1a63cfcc3d83919e790e7e279eb35fc75adb0e3c (patch) (unidiff) | |
tree | a2c613c6ae642dd6a4015142ccf04ed7c5629b8f | |
parent | 0928d8827a714f3908efa7eb9eb4cde28761af26 (diff) | |
download | cgit-1a63cfcc3d83919e790e7e279eb35fc75adb0e3c.zip cgit-1a63cfcc3d83919e790e7e279eb35fc75adb0e3c.tar.gz cgit-1a63cfcc3d83919e790e7e279eb35fc75adb0e3c.tar.bz2 |
Use & instead of & in URLs.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-commit.c | 8 | ||||
-rw-r--r-- | ui-log.c | 4 | ||||
-rw-r--r-- | ui-shared.c | 4 | ||||
-rw-r--r-- | ui-summary.c | 2 | ||||
-rw-r--r-- | ui-tree.c | 6 | ||||
-rw-r--r-- | ui-view.c | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/ui-commit.c b/ui-commit.c index 6b135aa..1d12bbb 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -66,25 +66,25 @@ void print_fileinfo(struct fileinfo *info) | |||
66 | } else { | 66 | } else { |
67 | html_filemode(info->new_mode); | 67 | html_filemode(info->new_mode); |
68 | } | 68 | } |
69 | 69 | ||
70 | if (info->old_mode != info->new_mode && | 70 | if (info->old_mode != info->new_mode && |
71 | !is_null_sha1(info->old_sha1) && | 71 | !is_null_sha1(info->old_sha1) && |
72 | !is_null_sha1(info->new_sha1)) { | 72 | !is_null_sha1(info->new_sha1)) { |
73 | html("<span class='modechange'>["); | 73 | html("<span class='modechange'>["); |
74 | html_filemode(info->old_mode); | 74 | html_filemode(info->old_mode); |
75 | html("]</span>"); | 75 | html("]</span>"); |
76 | } | 76 | } |
77 | htmlf("</td><td class='%s'>", class); | 77 | htmlf("</td><td class='%s'>", class); |
78 | query = fmt("id=%s&id2=%s&path=%s", sha1_to_hex(info->old_sha1), | 78 | query = fmt("id=%s&id2=%s&path=%s", sha1_to_hex(info->old_sha1), |
79 | sha1_to_hex(info->new_sha1), info->new_path); | 79 | sha1_to_hex(info->new_sha1), info->new_path); |
80 | html_link_open(cgit_pageurl(cgit_query_repo, "diff", query), | 80 | html_link_open(cgit_pageurl(cgit_query_repo, "diff", query), |
81 | NULL, NULL); | 81 | NULL, NULL); |
82 | if (info->status == DIFF_STATUS_COPIED || | 82 | if (info->status == DIFF_STATUS_COPIED || |
83 | info->status == DIFF_STATUS_RENAMED) { | 83 | info->status == DIFF_STATUS_RENAMED) { |
84 | html_txt(info->new_path); | 84 | html_txt(info->new_path); |
85 | htmlf("</a> (%s from ", info->status == DIFF_STATUS_COPIED ? | 85 | htmlf("</a> (%s from ", info->status == DIFF_STATUS_COPIED ? |
86 | "copied" : "renamed"); | 86 | "copied" : "renamed"); |
87 | query2 = fmt("id=%s", sha1_to_hex(info->old_sha1)); | 87 | query2 = fmt("id=%s", sha1_to_hex(info->old_sha1)); |
88 | html_link_open(cgit_pageurl(cgit_query_repo, "view", query2), | 88 | html_link_open(cgit_pageurl(cgit_query_repo, "view", query2), |
89 | NULL, NULL); | 89 | NULL, NULL); |
90 | html_txt(info->old_path); | 90 | html_txt(info->old_path); |
@@ -173,53 +173,53 @@ void cgit_print_commit(const char *hex) | |||
173 | html_txt(info->author_email); | 173 | html_txt(info->author_email); |
174 | html("</td><td class='right'>"); | 174 | html("</td><td class='right'>"); |
175 | cgit_print_date(info->author_date, FMT_LONGDATE); | 175 | cgit_print_date(info->author_date, FMT_LONGDATE); |
176 | html("</td></tr>\n"); | 176 | html("</td></tr>\n"); |
177 | html("<tr><th>committer</th><td>"); | 177 | html("<tr><th>committer</th><td>"); |
178 | html_txt(info->committer); | 178 | html_txt(info->committer); |
179 | html(" "); | 179 | html(" "); |
180 | html_txt(info->committer_email); | 180 | html_txt(info->committer_email); |
181 | html("</td><td class='right'>"); | 181 | html("</td><td class='right'>"); |
182 | cgit_print_date(info->committer_date, FMT_LONGDATE); | 182 | cgit_print_date(info->committer_date, FMT_LONGDATE); |
183 | html("</td></tr>\n"); | 183 | html("</td></tr>\n"); |
184 | html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='"); | 184 | html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='"); |
185 | query = fmt("h=%s&id=%s", sha1_to_hex(commit->object.sha1), | 185 | query = fmt("h=%s&id=%s", sha1_to_hex(commit->object.sha1), |
186 | sha1_to_hex(commit->tree->object.sha1)); | 186 | sha1_to_hex(commit->tree->object.sha1)); |
187 | html_attr(cgit_pageurl(cgit_query_repo, "tree", query)); | 187 | html_attr(cgit_pageurl(cgit_query_repo, "tree", query)); |
188 | htmlf("'>%s</a></td></tr>\n", sha1_to_hex(commit->tree->object.sha1)); | 188 | htmlf("'>%s</a></td></tr>\n", sha1_to_hex(commit->tree->object.sha1)); |
189 | for (p = commit->parents; p ; p = p->next) { | 189 | for (p = commit->parents; p ; p = p->next) { |
190 | parent = lookup_commit_reference(p->item->object.sha1); | 190 | parent = lookup_commit_reference(p->item->object.sha1); |
191 | if (!parent) { | 191 | if (!parent) { |
192 | html("<tr><td colspan='3'>"); | 192 | html("<tr><td colspan='3'>"); |
193 | cgit_print_error("Error reading parent commit"); | 193 | cgit_print_error("Error reading parent commit"); |
194 | html("</td></tr>"); | 194 | html("</td></tr>"); |
195 | continue; | 195 | continue; |
196 | } | 196 | } |
197 | html("<tr><th>parent</th>" | 197 | html("<tr><th>parent</th>" |
198 | "<td colspan='2' class='sha1'>" | 198 | "<td colspan='2' class='sha1'>" |
199 | "<a href='"); | 199 | "<a href='"); |
200 | query = fmt("h=%s", sha1_to_hex(p->item->object.sha1)); | 200 | query = fmt("h=%s", sha1_to_hex(p->item->object.sha1)); |
201 | html_attr(cgit_pageurl(cgit_query_repo, "commit", query)); | 201 | html_attr(cgit_pageurl(cgit_query_repo, "commit", query)); |
202 | htmlf("'>%s</a> (<a href='", | 202 | htmlf("'>%s</a> (<a href='", |
203 | sha1_to_hex(p->item->object.sha1)); | 203 | sha1_to_hex(p->item->object.sha1)); |
204 | query = fmt("id=%s&id2=%s", sha1_to_hex(parent->tree->object.sha1), | 204 | query = fmt("id=%s&id2=%s", sha1_to_hex(parent->tree->object.sha1), |
205 | sha1_to_hex(commit->tree->object.sha1)); | 205 | sha1_to_hex(commit->tree->object.sha1)); |
206 | html_attr(cgit_pageurl(cgit_query_repo, "diff", query)); | 206 | html_attr(cgit_pageurl(cgit_query_repo, "diff", query)); |
207 | html("'>diff</a>)</td></tr>"); | 207 | html("'>diff</a>)</td></tr>"); |
208 | } | 208 | } |
209 | if (cgit_repo->snapshots) { | 209 | if (cgit_repo->snapshots) { |
210 | htmlf("<tr><th>download</th><td colspan='2' class='sha1'><a href='"); | 210 | htmlf("<tr><th>download</th><td colspan='2' class='sha1'><a href='"); |
211 | filename = fmt("%s-%s.zip", cgit_query_repo, hex); | 211 | filename = fmt("%s-%s.zip", cgit_query_repo, hex); |
212 | html_attr(cgit_pageurl(cgit_query_repo, "snapshot", | 212 | html_attr(cgit_pageurl(cgit_query_repo, "snapshot", |
213 | fmt("id=%s&name=%s", hex, filename))); | 213 | fmt("id=%s&name=%s", hex, filename))); |
214 | htmlf("'>%s</a></td></tr>", filename); | 214 | htmlf("'>%s</a></td></tr>", filename); |
215 | } | 215 | } |
216 | html("</table>\n"); | 216 | html("</table>\n"); |
217 | html("<div class='commit-subject'>"); | 217 | html("<div class='commit-subject'>"); |
218 | html_txt(info->subject); | 218 | html_txt(info->subject); |
219 | html("</div>"); | 219 | html("</div>"); |
220 | html("<div class='commit-msg'>"); | 220 | html("<div class='commit-msg'>"); |
221 | html_txt(info->msg); | 221 | html_txt(info->msg); |
222 | html("</div>"); | 222 | html("</div>"); |
223 | if (!(commit->parents && commit->parents->next && commit->parents->next->next)) { | 223 | if (!(commit->parents && commit->parents->next && commit->parents->next->next)) { |
224 | html("<div class='diffstat-header'>Diffstat</div>"); | 224 | html("<div class='diffstat-header'>Diffstat</div>"); |
225 | html("<table class='diffstat'>"); | 225 | html("<table class='diffstat'>"); |
@@ -105,24 +105,24 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path) | |||
105 | print_commit(commit); | 105 | print_commit(commit); |
106 | free(commit->buffer); | 106 | free(commit->buffer); |
107 | commit->buffer = NULL; | 107 | commit->buffer = NULL; |
108 | free_commit_list(commit->parents); | 108 | free_commit_list(commit->parents); |
109 | commit->parents = NULL; | 109 | commit->parents = NULL; |
110 | } | 110 | } |
111 | html("</table>\n"); | 111 | html("</table>\n"); |
112 | 112 | ||
113 | html("<div class='pager'>"); | 113 | html("<div class='pager'>"); |
114 | if (ofs > 0) { | 114 | if (ofs > 0) { |
115 | html(" <a href='"); | 115 | html(" <a href='"); |
116 | html(cgit_pageurl(cgit_query_repo, cgit_query_page, | 116 | html(cgit_pageurl(cgit_query_repo, cgit_query_page, |
117 | fmt("h=%s&ofs=%d", tip, ofs-cnt))); | 117 | fmt("h=%s&ofs=%d", tip, ofs-cnt))); |
118 | html("'>[prev]</a> "); | 118 | html("'>[prev]</a> "); |
119 | } | 119 | } |
120 | 120 | ||
121 | if ((commit = get_revision(&rev)) != NULL) { | 121 | if ((commit = get_revision(&rev)) != NULL) { |
122 | html(" <a href='"); | 122 | html(" <a href='"); |
123 | html(cgit_pageurl(cgit_query_repo, "log", | 123 | html(cgit_pageurl(cgit_query_repo, "log", |
124 | fmt("h=%s&ofs=%d", tip, ofs+cnt))); | 124 | fmt("h=%s&ofs=%d", tip, ofs+cnt))); |
125 | html("'>[next]</a> "); | 125 | html("'>[next]</a> "); |
126 | } | 126 | } |
127 | html("</div>"); | 127 | html("</div>"); |
128 | } | 128 | } |
diff --git a/ui-shared.c b/ui-shared.c index c8c1c21..aba93e8 100644 --- a/ui-shared.c +++ b/ui-shared.c | |||
@@ -60,27 +60,27 @@ char *cgit_repourl(const char *reponame) | |||
60 | char *cgit_pageurl(const char *reponame, const char *pagename, | 60 | 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 | if (query) | 64 | if (query) |
65 | return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame, | 65 | return fmt("%s/%s/%s/?%s", cgit_virtual_root, reponame, |
66 | pagename, query); | 66 | pagename, 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); |
70 | } else { | 70 | } else { |
71 | if (query) | 71 | if (query) |
72 | return fmt("?r=%s&p=%s&%s", reponame, pagename, query); | 72 | return fmt("?r=%s&p=%s&%s", reponame, pagename, query); |
73 | else | 73 | else |
74 | return fmt("?r=%s&p=%s", reponame, pagename); | 74 | return fmt("?r=%s&p=%s", reponame, pagename); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | char *cgit_currurl() | 78 | char *cgit_currurl() |
79 | { | 79 | { |
80 | if (!cgit_virtual_root) | 80 | if (!cgit_virtual_root) |
81 | return cgit_script_name; | 81 | return cgit_script_name; |
82 | else if (cgit_query_page) | 82 | else if (cgit_query_page) |
83 | return fmt("%s/%s/%s/", cgit_virtual_root, cgit_query_repo, cgit_query_page); | 83 | return fmt("%s/%s/%s/", cgit_virtual_root, cgit_query_repo, cgit_query_page); |
84 | else if (cgit_query_repo) | 84 | else if (cgit_query_repo) |
85 | return fmt("%s/%s/", cgit_virtual_root, cgit_query_repo); | 85 | return fmt("%s/%s/", cgit_virtual_root, cgit_query_repo); |
86 | else | 86 | else |
diff --git a/ui-summary.c b/ui-summary.c index 18608b8..15e8aec 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -150,25 +150,25 @@ static int cgit_print_archive_cb(const char *refname, const unsigned char *sha1, | |||
150 | } else if (obj->type != OBJ_BLOB) { | 150 | } else if (obj->type != OBJ_BLOB) { |
151 | return 0; | 151 | return 0; |
152 | } else { | 152 | } else { |
153 | hashcpy(fileid, sha1); | 153 | hashcpy(fileid, sha1); |
154 | } | 154 | } |
155 | if (!header) { | 155 | if (!header) { |
156 | html("<table id='downloads'>"); | 156 | html("<table id='downloads'>"); |
157 | html("<tr><th>Downloads</th></tr>"); | 157 | html("<tr><th>Downloads</th></tr>"); |
158 | header = 1; | 158 | header = 1; |
159 | } | 159 | } |
160 | html("<tr><td>"); | 160 | html("<tr><td>"); |
161 | url = cgit_pageurl(cgit_query_repo, "blob", | 161 | url = cgit_pageurl(cgit_query_repo, "blob", |
162 | fmt("id=%s&path=%s", sha1_to_hex(fileid), | 162 | fmt("id=%s&path=%s", sha1_to_hex(fileid), |
163 | buf)); | 163 | buf)); |
164 | html_link_open(url, NULL, NULL); | 164 | html_link_open(url, NULL, NULL); |
165 | html_txt(buf); | 165 | html_txt(buf); |
166 | html_link_close(); | 166 | html_link_close(); |
167 | html("</td></tr>"); | 167 | html("</td></tr>"); |
168 | return 0; | 168 | return 0; |
169 | } | 169 | } |
170 | 170 | ||
171 | static void cgit_print_branches() | 171 | static void cgit_print_branches() |
172 | { | 172 | { |
173 | html("<tr class='nohover'><th class='left'>Branch</th>" | 173 | html("<tr class='nohover'><th class='left'>Branch</th>" |
174 | "<th class='left'>Idle</th>" | 174 | "<th class='left'>Idle</th>" |
@@ -28,43 +28,43 @@ static int print_entry(const unsigned char *sha1, const char *base, | |||
28 | } | 28 | } |
29 | html("<tr><td class='filemode'>"); | 29 | html("<tr><td class='filemode'>"); |
30 | html_filemode(mode); | 30 | html_filemode(mode); |
31 | html("</td><td "); | 31 | html("</td><td "); |
32 | if (S_ISDIRLNK(mode)) { | 32 | if (S_ISDIRLNK(mode)) { |
33 | htmlf("class='ls-mod'><a href='"); | 33 | htmlf("class='ls-mod'><a href='"); |
34 | html_attr(fmt(cgit_repo->module_link, | 34 | html_attr(fmt(cgit_repo->module_link, |
35 | name, | 35 | name, |
36 | sha1_to_hex(sha1))); | 36 | sha1_to_hex(sha1))); |
37 | } else if (S_ISDIR(mode)) { | 37 | } else if (S_ISDIR(mode)) { |
38 | html("class='ls-dir'><a href='"); | 38 | html("class='ls-dir'><a href='"); |
39 | html_attr(cgit_pageurl(cgit_query_repo, "tree", | 39 | html_attr(cgit_pageurl(cgit_query_repo, "tree", |
40 | fmt("h=%s&id=%s&path=%s%s/", | 40 | fmt("h=%s&id=%s&path=%s%s/", |
41 | curr_rev, | 41 | curr_rev, |
42 | sha1_to_hex(sha1), | 42 | sha1_to_hex(sha1), |
43 | cgit_query_path ? cgit_query_path : "", | 43 | cgit_query_path ? cgit_query_path : "", |
44 | pathname))); | 44 | pathname))); |
45 | } else { | 45 | } else { |
46 | html("class='ls-blob'><a href='"); | 46 | html("class='ls-blob'><a href='"); |
47 | html_attr(cgit_pageurl(cgit_query_repo, "view", | 47 | html_attr(cgit_pageurl(cgit_query_repo, "view", |
48 | fmt("h=%s&id=%s&path=%s%s", curr_rev, | 48 | fmt("h=%s&id=%s&path=%s%s", curr_rev, |
49 | sha1_to_hex(sha1), | 49 | sha1_to_hex(sha1), |
50 | cgit_query_path ? cgit_query_path : "", | 50 | cgit_query_path ? cgit_query_path : "", |
51 | pathname))); | 51 | pathname))); |
52 | } | 52 | } |
53 | htmlf("'>%s</a></td>", name); | 53 | htmlf("'>%s</a></td>", name); |
54 | htmlf("<td class='filesize'>%li</td>", size); | 54 | htmlf("<td class='filesize'>%li</td>", size); |
55 | 55 | ||
56 | html("<td class='links'><a href='"); | 56 | html("<td class='links'><a href='"); |
57 | html_attr(cgit_pageurl(cgit_query_repo, "log", | 57 | html_attr(cgit_pageurl(cgit_query_repo, "log", |
58 | fmt("h=%s&path=%s%s", | 58 | fmt("h=%s&path=%s%s", |
59 | curr_rev, | 59 | curr_rev, |
60 | cgit_query_path ? cgit_query_path : "", | 60 | cgit_query_path ? cgit_query_path : "", |
61 | pathname))); | 61 | pathname))); |
62 | html("'>history</a></td>"); | 62 | html("'>history</a></td>"); |
63 | html("</tr>\n"); | 63 | html("</tr>\n"); |
64 | free(name); | 64 | free(name); |
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
67 | 67 | ||
68 | void cgit_print_tree(const char *rev, const char *hex, char *path) | 68 | void cgit_print_tree(const char *rev, const char *hex, char *path) |
69 | { | 69 | { |
70 | struct tree *tree; | 70 | struct tree *tree; |
@@ -34,22 +34,22 @@ void cgit_print_view(const char *hex, char *path) | |||
34 | 34 | ||
35 | buf[size] = '\0'; | 35 | buf[size] = '\0'; |
36 | html("<table class='list'>\n"); | 36 | html("<table class='list'>\n"); |
37 | html("<tr class='nohover'><th class='left'>"); | 37 | html("<tr class='nohover'><th class='left'>"); |
38 | if (path) | 38 | if (path) |
39 | htmlf("%s (", path); | 39 | htmlf("%s (", path); |
40 | htmlf("%s %s, %li bytes", typename(type), hex, size); | 40 | htmlf("%s %s, %li bytes", typename(type), hex, size); |
41 | if (path) | 41 | if (path) |
42 | html(")"); | 42 | html(")"); |
43 | 43 | ||
44 | html(" <a href='"); | 44 | html(" <a href='"); |
45 | html_attr(cgit_pageurl(cgit_query_repo, "blob", | 45 | html_attr(cgit_pageurl(cgit_query_repo, "blob", |
46 | fmt("id=%s&path=%s", | 46 | fmt("id=%s&path=%s", |
47 | hex, | 47 | hex, |
48 | path))); | 48 | path))); |
49 | html("'>download</a>"); | 49 | html("'>download</a>"); |
50 | html("</th></tr>\n"); | 50 | html("</th></tr>\n"); |
51 | html("<tr><td class='blob'>\n"); | 51 | html("<tr><td class='blob'>\n"); |
52 | html_txt(buf); | 52 | html_txt(buf); |
53 | html("\n</td></tr>\n"); | 53 | html("\n</td></tr>\n"); |
54 | html("</table>\n"); | 54 | html("</table>\n"); |
55 | } | 55 | } |