Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorStephan Feder <sf@b-i-t.de>2006-07-07 14:33:44 +0400
committerJunio C Hamano <junkio@cox.net>2006-07-07 14:48:10 +0400
commitc9c95bbc9c9f7b8a3c87ab486b4aec220a239577 (patch)
tree71aeec2e363c19b111868dc5b94b7defa765fe07 /diff.c
parent97beb812dbbba750e6c9326a7f25655ebcf7bb44 (diff)
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 <sf@b-i-t.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 507e4019e8..f0450a8b0b 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)