From: Stephan Feder Date: Fri, 7 Jul 2006 10:33:44 +0000 (+0200) Subject: Do not drop data from '\0' until eol in patch output X-Git-Tag: v1.4.2-rc1~73 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c9c95bbc9c9f7b8a3c87ab486b4aec220a239577;p=git.git Do not drop data from '\0' until eol in patch output The binary file detection is just a heuristic which can well fail. Do not produce garbage patches in these cases. Signed-off-by: Stephan Feder Signed-off-by: Junio C Hamano --- diff --git a/diff.c b/diff.c index 507e4019e..f0450a8b0 100644 --- a/diff.c +++ b/diff.c @@ -329,7 +329,9 @@ static void fn_out_consume(void *priv, char *line, unsigned long len) } if (len > 0 && line[len-1] == '\n') len--; - printf("%s%.*s%s\n", set, (int) len, line, reset); + fputs (set, stdout); + fwrite (line, len, 1, stdout); + puts (reset); } static char *pprint_rename(const char *a, const char *b)