]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
ui-repolist: use correct owner query link
[ps-cgit] / ui-shared.c
index 32f23f9d98355d5233035ecf5a7cae379df5ddc4..1a84afc6bf39564aa73ef7f58826fe9f67f985f1 100644 (file)
@@ -273,9 +273,9 @@ void cgit_summary_link(const char *name, const char *title, const char *class,
 }
 
 void cgit_tag_link(const char *name, const char *title, const char *class,
 }
 
 void cgit_tag_link(const char *name, const char *title, const char *class,
-                  const char *head, const char *rev)
+                  const char *tag)
 {
 {
-       reporevlink("tag", name, title, class, head, rev, NULL);
+       reporevlink("tag", name, title, class, tag, NULL, NULL);
 }
 
 void cgit_tree_link(const char *name, const char *title, const char *class,
 }
 
 void cgit_tree_link(const char *name, const char *title, const char *class,
@@ -443,8 +443,8 @@ static void cgit_self_link(char *name, const char *title, const char *class)
        else if (!strcmp(ctx.qry.page, "summary"))
                cgit_summary_link(name, title, class, ctx.qry.head);
        else if (!strcmp(ctx.qry.page, "tag"))
        else if (!strcmp(ctx.qry.page, "summary"))
                cgit_summary_link(name, title, class, ctx.qry.head);
        else if (!strcmp(ctx.qry.page, "tag"))
-               cgit_tag_link(name, title, class, ctx.qry.head,
-                             ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL);
+               cgit_tag_link(name, title, class, ctx.qry.has_sha1 ?
+                              ctx.qry.sha1 : ctx.qry.head);
        else if (!strcmp(ctx.qry.page, "tree"))
                cgit_tree_link(name, title, class, ctx.qry.head,
                               ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
        else if (!strcmp(ctx.qry.page, "tree"))
                cgit_tree_link(name, title, class, ctx.qry.head,
                               ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
@@ -751,31 +751,19 @@ void cgit_print_docend()
 
 static void add_clone_urls(void (*fn)(const char *), char *txt, char *suffix)
 {
 
 static void add_clone_urls(void (*fn)(const char *), char *txt, char *suffix)
 {
-       struct strbuf buf = STRBUF_INIT;
-       char *h = txt, *t, c;
+       struct strbuf **url_list = strbuf_split_str(txt, ' ', 0);
+       int i;
 
 
-       while (h && *h) {
-               while (h && *h == ' ')
-                       h++;
-               if (!*h)
-                       break;
-               t = h;
-               while (t && *t && *t != ' ')
-                       t++;
-               c = *t;
-               *t = 0;
-
-               if (suffix && *suffix) {
-                       strbuf_reset(&buf);
-                       strbuf_addf(&buf, "%s/%s", h, suffix);
-                       h = buf.buf;
-               }
-               fn(h);
-               *t = c;
-               h = t;
+       for (i = 0; url_list[i]; i++) {
+               strbuf_rtrim(url_list[i]);
+               if (url_list[i]->len == 0)
+                       continue;
+               if (suffix && *suffix)
+                       strbuf_addf(url_list[i], "/%s", suffix);
+               fn(url_list[i]->buf);
        }
 
        }
 
-       strbuf_release(&buf);
+       strbuf_list_free(url_list);
 }
 
 void cgit_add_clone_urls(void (*fn)(const char *))
 }
 
 void cgit_add_clone_urls(void (*fn)(const char *))