Re: [PATCH 7/7] Make --color-words work well with --graph.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bo Yang wrote:
> @@ -629,20 +640,39 @@ static void fn_out_diff_words_aux(void *priv, char *line, unsigned long len)
>  	} else
>  		plus_begin = plus_end = diff_words->plus.orig[plus_first].end;
>  
> -	if (diff_words->current_plus != plus_begin)
> -		fwrite(diff_words->current_plus,
> -				plus_begin - diff_words->current_plus, 1,
> -				diff_words->file);
> -	if (minus_begin != minus_end)
> -		color_fwrite_lines(diff_words->file,
> +	if (diff_words->current_plus != plus_begin) {
> +		if ((diff_words->current_plus == diff_words->plus.text.ptr &&
> +			diff_words->last_minus == 0) ||
> +			(diff_words->current_plus > diff_words->plus.text.ptr &&
> +			*(diff_words->current_plus - 1) == '\n')) {
> +			fputs(line_prefix, diff_words->opt->file);
> +			print = 1;

Are these border checks needed/the best solution?  If so, please can
you put an explanation in the commit message?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]