Re: [PATCH] parse_dirstat_params(): use string_list to split comma-separated string

2012-10-31 Thread Matt Kraai
On Wed, Oct 31, 2012 at 10:06:36AM -0400, Jeff King wrote: > On Tue, Oct 30, 2012 at 06:43:51PM +, Matt Kraai wrote: > > > Michael Haggerty alum.mit.edu> writes: > > > + if (*params_copy) > > > > params_copy is set to the value returned by xstrdup, which cannot be NULL. > > This check can be

Re: [PATCH] parse_dirstat_params(): use string_list to split comma-separated string

2012-10-31 Thread Jeff King
On Tue, Oct 30, 2012 at 06:43:51PM +, Matt Kraai wrote: > Michael Haggerty alum.mit.edu> writes: > ... > > -static int parse_dirstat_params(struct diff_options *options, const char > > ... > > +static int parse_dirstat_params(struct diff_options *options, const char > > ... > >

Re: [PATCH] parse_dirstat_params(): use string_list to split comma-separated string

2012-10-30 Thread Matt Kraai
Michael Haggerty alum.mit.edu> writes: ... > -static int parse_dirstat_params(struct diff_options *options, const char ... > +static int parse_dirstat_params(struct diff_options *options, const char ... > struct strbuf *errmsg) > { > - const char *p = params; > -

[PATCH] parse_dirstat_params(): use string_list to split comma-separated string

2012-10-28 Thread Michael Haggerty
Use string_list_split_in_place() to split the comma-separated parameters string. This simplifies the code and also fixes a bug: the old code made calls like memcmp(p, "lines", p_len) which needn't work if p_len is different than the length of the constant string (and could illegally access m