X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=diff-tree.c;h=80d02b4f5ba7bb86a6bd29662ecdd12bbb516fbf;hb=847941fdd962d71a724d72b9f90389bae835d2c0;hp=8297b7f3a950e66baa5369eb551ab9de453bf13b;hpb=fbe082a528861af785be15bb37d1c7d8f574daa4;p=git.git diff --git a/diff-tree.c b/diff-tree.c index 8297b7f3..80d02b4f 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -269,18 +269,11 @@ static int call_diff_flush(void) return 0; } if (header) { - if (diff_output_format == DIFF_FORMAT_MACHINE) { - const char *ep, *cp; - for (cp = header; *cp; cp = ep) { - ep = strchr(cp, '\n'); - if (ep == 0) ep = cp + strlen(cp); - printf("%.*s%c", ep-cp, cp, 0); - if (*ep) ep++; - } - } - else { - printf("%s", header); - } + const char *fmt = "%s"; + if (diff_output_format == DIFF_FORMAT_MACHINE) + fmt = "%s%c"; + + printf(fmt, header, 0); header = NULL; } diff_flush(diff_output_format, 1);