all repos — cgit @ 6d3c8bc37f6124c2193d66587079975d381aa435

a hyperfast web frontend for git written in c

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>
John Keeping john@keeping.me.uk
Sun, 15 Jan 2017 12:29:38 +0000
commit

6d3c8bc37f6124c2193d66587079975d381aa435

parent

86a6d358f7a6c2432fde86b9e3c5011a656f20e4

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M ui-atom.cui-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); }