Re: [PATCH 3/6] Rework pretty_print_commit to use strbufs instead of custom buffers.

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

 



On Sun, Sep 09, 2007 at 11:48:17PM +0000, Junio C Hamano wrote:
> Pierre Habouzit <madcoder@xxxxxxxxxx> writes:
> 
> > +void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
> > +				  struct strbuf *sb, int abbrev,
> > +				  const char *subject, const char *after_subject,
> >  				  enum date_mode dmode)
> >  {
> > -	unsigned long offset = 0;
> >  	unsigned long beginning_of_body;
> >  	int indent = 4;
> >  	const char *msg = commit->buffer;
> >  	int plain_non_ascii = 0;
> >  	char *reencoded;
> >  	const char *encoding;
> > -	char *buf;
> >  
> >  	if (fmt == CMIT_FMT_USERFORMAT)
> > -		return format_commit_message(commit, user_format, buf_p, space_p);
> > +		return format_commit_message(commit, user_format, sb);
> >  
> >  	encoding = (git_log_output_encoding
> >  		    ? git_log_output_encoding
> 
> No way this can be correct.

  Actually this is, but it's so tasteless that I want to hide now.

  if foo is a void foo(`whatever') it's correct to call:

  return foo(...);

  it's completely equivalent to:

  foo(...);
  return;

  But it reads soo wrong that I'll fix that. The reason why I missed
that is that format_commit_message used to return a size_t or some
integer type.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgpTg1Z5yarEn.pgp
Description: PGP signature


[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