author | Lars Hjemli <hjemli@gmail.com> | 2008-10-05 19:21:42 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-10-05 19:21:42 (UTC) |
commit | 0071aa8612c12f626355339d2108ed4c5b336d58 (patch) (unidiff) | |
tree | c9516909d6570a9da8f71dbc9d30b9222826125e | |
parent | 24d4bb3058e02c61ae4ea61c3a3d993564bed79b (diff) | |
download | cgit-0071aa8612c12f626355339d2108ed4c5b336d58.zip cgit-0071aa8612c12f626355339d2108ed4c5b336d58.tar.gz cgit-0071aa8612c12f626355339d2108ed4c5b336d58.tar.bz2 |
ui-summary: use html_url_path()
This makes the clone urls be properly escaped.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-summary.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-summary.c b/ui-summary.c index 29e1544..ede4a62 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -3,49 +3,49 @@ | |||
3 | * Copyright (C) 2006 Lars Hjemli | 3 | * Copyright (C) 2006 Lars Hjemli |
4 | * | 4 | * |
5 | * Licensed under GNU General Public License v2 | 5 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) | 6 | * (see COPYING for full license text) |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "cgit.h" | 9 | #include "cgit.h" |
10 | #include "html.h" | 10 | #include "html.h" |
11 | #include "ui-log.h" | 11 | #include "ui-log.h" |
12 | #include "ui-refs.h" | 12 | #include "ui-refs.h" |
13 | 13 | ||
14 | int urls = 0; | 14 | int urls = 0; |
15 | 15 | ||
16 | static void print_url(char *base, char *suffix) | 16 | static void print_url(char *base, char *suffix) |
17 | { | 17 | { |
18 | if (!base || !*base) | 18 | if (!base || !*base) |
19 | return; | 19 | return; |
20 | if (urls++ == 0) { | 20 | if (urls++ == 0) { |
21 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); | 21 | html("<tr class='nohover'><td colspan='4'> </td></tr>"); |
22 | html("<tr><th class='left' colspan='4'>Clone</th></tr>\n"); | 22 | html("<tr><th class='left' colspan='4'>Clone</th></tr>\n"); |
23 | } | 23 | } |
24 | if (suffix && *suffix) | 24 | if (suffix && *suffix) |
25 | base = fmt("%s/%s", base, suffix); | 25 | base = fmt("%s/%s", base, suffix); |
26 | html("<tr><td colspan='4'><a href='"); | 26 | html("<tr><td colspan='4'><a href='"); |
27 | html_attr(base); | 27 | html_url_path(base); |
28 | html("'>"); | 28 | html("'>"); |
29 | html_txt(base); | 29 | html_txt(base); |
30 | html("</a></td></tr>\n"); | 30 | html("</a></td></tr>\n"); |
31 | } | 31 | } |
32 | 32 | ||
33 | static void print_urls(char *txt, char *suffix) | 33 | static void print_urls(char *txt, char *suffix) |
34 | { | 34 | { |
35 | char *h = txt, *t, c; | 35 | char *h = txt, *t, c; |
36 | 36 | ||
37 | while (h && *h) { | 37 | while (h && *h) { |
38 | while (h && *h == ' ') | 38 | while (h && *h == ' ') |
39 | h++; | 39 | h++; |
40 | t = h; | 40 | t = h; |
41 | while (t && *t && *t != ' ') | 41 | while (t && *t && *t != ' ') |
42 | t++; | 42 | t++; |
43 | c = *t; | 43 | c = *t; |
44 | *t = 0; | 44 | *t = 0; |
45 | print_url(h, suffix); | 45 | print_url(h, suffix); |
46 | *t = c; | 46 | *t = c; |
47 | h = t; | 47 | h = t; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | void cgit_print_summary() | 51 | void cgit_print_summary() |