Commit Diff


commit - 12003b6a72fbdc20ec40693e5d4d6933c5455e47
commit + ebc6542a26dbc7b2b6e196251745f9dc7a9b9cf6
blob - 3bcfcd1c8227020bfa99725fdb0daace5c4d55e6
blob + 8317195aa694b670345ea0ae9c1af1503df773ad
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
@@ -3755,12 +3755,9 @@ gw_blame_cb(void *arg, int nlines, int lineno, struct 
 		if (kerr != KCGI_OK)
 			goto err;
 
-		if (asprintf(&href_diff,
-		    "?path=%s&action=diff&commit=%s",
-		    a->gw_trans->repo_name, bline->id_str) == -1) {
-			err = got_error_from_errno("asprintf");
-			goto err;
-		}
+		href_diff = khttp_urlpart(NULL, NULL, "gotweb", "path",
+		    a->gw_trans->repo_name, "action", "diff", "commit",
+		    bline->id_str, NULL);
 		kerr = khtml_attr(a->gw_trans->gw_html_req, KELEM_A,
 		    KATTR_HREF, href_diff, KATTR__MAX);
 		if (kerr != KCGI_OK)