cgit

commit 6d3c8bc37f6124c2193d66587079975d381aa435

Author: John Keeping <john@keeping.me.uk>

ui-atom: properly escape delimiter in page link

If the delimiter here is '&' then it needs to be escaped for inclusion
in an attribute.  Use html_attrf() to ensure that this happens (we know
that hex won't need escaping, but this makes it clearer what's
happening.

Signed-off-by: John Keeping <john@keeping.me.uk>

 ui-atom.c | 2 +-


diff --git a/ui-atom.c b/ui-atom.c
index 41838d38b7acb2381dd17e509e330da6678e452c..3866823b4baff1401b65ffb5987fc09e652b2963 100644
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -63,7 +63,7 @@ 		pageurl = cgit_pageurl(ctx.repo->url, "commit", NULL);
 		html_attr(pageurl);
 		if (ctx.cfg.virtual_root)
 			delim = '?';
-		htmlf("%cid=%s", delim, hex);
+		html_attrf("%cid=%s", delim, hex);
 		html("'/>\n");
 		free(pageurl);
 	}