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 <cgit@cryptocrack.de>
#include "ui-refs.h"
#include "ui-blob.h"
#include "ui-refs.h"
#include "ui-blob.h"
static void print_url(char *base, char *suffix)
{
int columns = 3;
static void print_url(char *base, char *suffix)
{
int columns = 3;
if (!base || !*base)
return;
if (!base || !*base)
return;
- if (urls++ == 0) {
- htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns);
- htmlf("<tr><th class='left' colspan='%d'>Clone</th></tr>\n", columns);
- }
if (suffix && *suffix)
base = fmt("%s/%s", base, suffix);
htmlf("<tr><td colspan='%d'><a href='", columns);
if (suffix && *suffix)
base = fmt("%s/%s", base, suffix);
htmlf("<tr><td colspan='%d'><a href='", columns);
static void print_urls(char *txt, char *suffix)
{
char *h = txt, *t, c;
static void print_urls(char *txt, char *suffix)
{
char *h = txt, *t, c;
+ int urls = 0;
+ int columns = 3;
+
+ if (ctx.repo->enable_log_filecount)
+ columns++;
+ if (ctx.repo->enable_log_linecount)
+ columns++;
+
while (h && *h) {
while (h && *h == ' ')
h++;
while (h && *h) {
while (h && *h == ' ')
h++;
t = h;
while (t && *t && *t != ' ')
t++;
c = *t;
*t = 0;
t = h;
while (t && *t && *t != ' ')
t++;
c = *t;
*t = 0;
+ if (urls++ == 0) {
+ htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns);
+ htmlf("<tr><th class='left' colspan='%d'>Clone</th></tr>\n", columns);
+ }
print_url(h, suffix);
*t = c;
h = t;
print_url(h, suffix);
*t = c;
h = t;