commit - c6eb96ac367cd9bc0fcf22bb4ca88c245b56f622
commit + e678920974066e4364fabf97bd4ab978237ff675
blob - c3ad3f70f07fd788d28a35c79e53124b5b4485cc
blob + 929d046c7ad23e7cee718a1c10c13bbb1b96e88c
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
KATTR_ID, "head", KATTR__MAX);
if (kerr != KCGI_OK)
goto done;
- if (asprintf(&href_summary,
- "?path=%s&action=summary&headref=%s",
- gw_trans->repo_name, refname) == -1) {
- error = got_error_from_errno("asprintf");
- goto done;
- }
+
+ href_summary = khttp_urlpart(NULL, NULL, "gotweb", "path",
+ gw_trans->repo_name, "action", "summary", "headref",
+ refname, NULL),
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_summary, KATTR__MAX);
kerr = khtml_puts(gw_trans->gw_html_req, refname);
kerr = khtml_puts(gw_trans->gw_html_req, " | ");
if (kerr != KCGI_OK)
- goto done;
- if (asprintf(&href_briefs, "?path=%s&action=briefs&headref=%s",
- gw_trans->repo_name, refname) == -1) {
- error = got_error_from_errno("asprintf");
goto done;
- }
+
+ href_briefs = khttp_urlpart(NULL, NULL, "gotweb", "path",
+ gw_trans->repo_name, "action", "briefs", "headref",
+ refname, NULL);
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_briefs, KATTR__MAX);
if (kerr != KCGI_OK)
if (kerr != KCGI_OK)
goto done;
- if (asprintf(&href_commits,
- "?path=%s&action=commits&headref=%s",
- gw_trans->repo_name, refname) == -1) {
- error = got_error_from_errno("asprintf");
- goto done;
- }
+ href_commits = khttp_urlpart(NULL, NULL, "gotweb", "path",
+ gw_trans->repo_name, "action", "commits", "headref",
+ refname, NULL),
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_commits, KATTR__MAX);
if (kerr != KCGI_OK)