Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'maint'
author
Junio C Hamano
<gitster@pobox.com>
Mon, 16 Jun 2008 23:14:22 +0000
(16:14 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 16 Jun 2008 23:14:22 +0000
(16:14 -0700)
* maint:
diff: reset color before printing newline
diff.c
patch
|
blob
|
history
raw
(from parent 1:
336d09d
)
diff --git
a/diff.c
b/diff.c
index 62fdc5492bbe5dacab6bc5b615a76ba5cd9de760..f23657bd347a62729d2211e8c64536279a5ea910 100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-514,9
+514,13
@@
const char *diff_get_color(int diff_use_color, enum color_diff ix)
static void emit_line(FILE *file, const char *set, const char *reset, const char *line, int len)
{
+ if (len > 0 && line[len-1] == '\n')
+ len--;
+
fputs(set, file);
fwrite(line, len, 1, file);
fputs(reset, file);
+ fputc('\n', file);
}
static void emit_add_line(const char *reset, struct emit_callback *ecbdata, const char *line, int len)