From: Stephan Feder <sf@b-i-t.de>
To: git@vger.kernel.org
Subject: [PATCH] Do not drop data from '\0' until eol in patch output
Date: Fri, 07 Jul 2006 12:33:44 +0200 [thread overview]
Message-ID: <1152268424350-git-send-email-sf@b-i-t.de> (raw)
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>
---
diff.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/diff.c b/diff.c
index 507e401..f0450a8 100644
--- a/diff.c
+++ b/diff.c
@@ -329,7 +329,9 @@ static void fn_out_consume(void *priv, c
}
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)
--
1.4.1.gbc483
next reply other threads:[~2006-07-07 10:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-07 10:33 Stephan Feder [this message]
2006-07-07 10:52 ` [PATCH] Do not drop data from '\0' until eol in patch output Junio C Hamano
2006-07-07 11:18 ` sf
2006-07-07 12:03 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1152268424350-git-send-email-sf@b-i-t.de \
--to=sf@b-i-t.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).