aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui-summary.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/ui-summary.c b/ui-summary.c
index 38639ce..0754bb7 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -13,8 +13,6 @@
13#include "ui-refs.h" 13#include "ui-refs.h"
14#include "ui-blob.h" 14#include "ui-blob.h"
15 15
16int urls = 0;
17
18static void print_url(char *base, char *suffix) 16static void print_url(char *base, char *suffix)
19{ 17{
20 int columns = 3; 18 int columns = 3;
@@ -26,10 +24,6 @@ static void print_url(char *base, char *suffix)
26 24
27 if (!base || !*base) 25 if (!base || !*base)
28 return; 26 return;
29 if (urls++ == 0) {
30 htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
31 htmlf("<tr><th class='left' colspan='%d'>Clone</th></tr>\n", columns);
32 }
33 if (suffix && *suffix) 27 if (suffix && *suffix)
34 base = fmt("%s/%s", base, suffix); 28 base = fmt("%s/%s", base, suffix);
35 htmlf("<tr><td colspan='%d'><a href='", columns); 29 htmlf("<tr><td colspan='%d'><a href='", columns);
@@ -42,15 +36,29 @@ static void print_url(char *base, char *suffix)
42static void print_urls(char *txt, char *suffix) 36static void print_urls(char *txt, char *suffix)
43{ 37{
44 char *h = txt, *t, c; 38 char *h = txt, *t, c;
39 int urls = 0;
40 int columns = 3;
41
42 if (ctx.repo->enable_log_filecount)
43 columns++;
44 if (ctx.repo->enable_log_linecount)
45 columns++;
46
45 47
46 while (h && *h) { 48 while (h && *h) {
47 while (h && *h == ' ') 49 while (h && *h == ' ')
48 h++; 50 h++;
51 if (!*h)
52 break;
49 t = h; 53 t = h;
50 while (t && *t && *t != ' ') 54 while (t && *t && *t != ' ')
51 t++; 55 t++;
52 c = *t; 56 c = *t;
53 *t = 0; 57 *t = 0;
58 if (urls++ == 0) {
59 htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
60 htmlf("<tr><th class='left' colspan='%d'>Clone</th></tr>\n", columns);
61 }
54 print_url(h, suffix); 62 print_url(h, suffix);
55 *t = c; 63 *t = c;
56 h = t; 64 h = t;