From 977a3ad7bf212e6ec7f43c16763321061ee64a69 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 5 Mar 2013 16:48:27 +0100 Subject: ui-summary.c: Move urls variable into print_urls() There's no need for this variable to be global. Printing the header in print_urls() instead of print_url() allows for moving this variable into print_urls() without having to pass any status to print_url(). Note that this only works as long as we don't call print_urls() more than once. Signed-off-by: Lukas Fleischer --- ui-summary.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'ui-summary.c') 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 @@ #include "ui-refs.h" #include "ui-blob.h" -int urls = 0; - static void print_url(char *base, char *suffix) { int columns = 3; @@ -26,10 +24,6 @@ static void print_url(char *base, char *suffix) if (!base || !*base) return; - if (urls++ == 0) { - htmlf(" ", columns); - htmlf("Clone\n", columns); - } if (suffix && *suffix) base = fmt("%s/%s", base, suffix); htmlf(" ", columns); + htmlf("Clone\n", columns); + } print_url(h, suffix); *t = c; h = t; -- cgit v1.2.3-24-g4f1b