aboutsummaryrefslogtreecommitdiffstats
path: root/stagit.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stagit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stagit.c b/stagit.c
index 026992c..27db7a6 100644
--- a/stagit.c
+++ b/stagit.c
@@ -409,7 +409,9 @@ printshowfile(struct commitinfo *ci)
if (git_patch_get_hunk(&hunk, &nhunklines, patch, j))
break;
- fprintf(fp, "<span class=\"h\">%s</span>\n", hunk->header);
+ fputs("<span class=\"h\">", fp);
+ xmlencode(fp, hunk->header, strcspn(hunk->header, "\n"));
+ fputs("</span>", fp);
for (k = 0; ; k++) {
if (git_patch_get_line_in_hunk(&line, patch, j, k))