summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9c9cef)
raw | patch | inline | side by side (parent: a9c9cef)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Fri, 27 May 2005 17:22:09 +0000 (10:22 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Fri, 27 May 2005 17:22:09 +0000 (10:22 -0700) |
No need to make them multiple lines, in fact we explicitly don't want that.
This also fixes a 64-bit problem pointed out by Markus F.X.J. Oberhumer,
where we gave "%.*s" a "ptrdiff_t" length argument instead of an "int".
This also fixes a 64-bit problem pointed out by Markus F.X.J. Oberhumer,
where we gave "%.*s" a "ptrdiff_t" length argument instead of an "int".
diff-tree.c | patch | blob | history |
diff --git a/diff-tree.c b/diff-tree.c
index 8297b7f3a950e66baa5369eb551ab9de453bf13b..80d02b4f5ba7bb86a6bd29662ecdd12bbb516fbf 100644 (file)
--- a/diff-tree.c
+++ b/diff-tree.c
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);