mirror of
https://github.com/git/git.git
synced 2024-12-11 10:54:21 +08:00
Merge branch 'maint'
* maint: diff: reset color before printing newline
This commit is contained in:
commit
9dc784a970
4
diff.c
4
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)
|
||||
|
Loading…
Reference in New Issue
Block a user