Re: [PATCH 07/15] sequencer: make sequencer_make_script() write its script to a strbuf

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

 



On Fri, Oct 19, 2018 at 05:16:46PM +0900, Junio C Hamano wrote:
> SZEDER Gábor <szeder.dev@xxxxxxxxx> writes:
> 
> >>  		if (entry)
> >> -			fprintf(out, "\n%c Branch %s\n", comment_line_char, entry->string);
> >> +			strbuf_addf(out, "\n%c Branch %s\n", comment_line_char, entry->string);
> >>  		else
> >> -			fprintf(out, "\n");
> >> +			strbuf_addf(out, "\n");
> >
> > Please use plain strbuf_add() here.
> 
> FWIW, contrib/coccinelle/strbuf.cocci.patch gave us this:
> 
> diff -u -p a/sequencer.c b/sequencer.c
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -4311,7 +4311,7 @@ static int make_script_with_merges(struc
>  		if (entry)
>  			strbuf_addf(out, "\n%c Branch %s\n", comment_line_char, entry->string);
>  		else
> -			strbuf_addf(out, "\n");
> +			strbuf_addstr(out, "\n");
>  
>  		while (oidset_contains(&interesting, &commit->object.oid) &&
>  		       !oidset_contains(&shown, &commit->object.oid)) {

Uh, right.  I didn't want to copy-paste a patch with too long lines
into my mailer, as it usually doesn't end too good, so I just typed
the function name.  Evidently I couldn't quite manage.




[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]

  Powered by Linux