From a89e756c9e59d41cb1e392616333be50b3960c71 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 4 Jan 2016 23:41:40 +0100 Subject: [PATCH] stagit: fix hunk header, thanks uggedal for reporting! --- stagit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, "%s\n", hunk->header); + fputs("", fp); + xmlencode(fp, hunk->header, strcspn(hunk->header, "\n")); + fputs("", fp); for (k = 0; ; k++) { if (git_patch_get_line_in_hunk(&line, patch, j, k)) -- libgit2 1.1.1