Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  diff: reset color before printing newline
  • Loading branch information
Junio C Hamano committed Jun 16, 2008
2 parents 336d09d + 06ff64a commit 9dc784a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9dc784a

Please sign in to comment.