Re: [PATCH 3/4] connect: learn to parse capabilities with values

2012-08-13 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: I forgot to mention it, but the above was done also to make it possible but not mandatory to pay extra allocation penalty. The caller can choose to parse the string into an int, for example, without extra allocation. Only the ones that want a string

Re: [PATCH 3/4] connect: learn to parse capabilities with values

2012-08-10 Thread Eric Sunshine
On Fri, Aug 10, 2012 at 3:58 AM, Jeff King p...@peff.net wrote: + * Parse features of the form feature=value. Returns NULL if the feature + * does not exist, the empty string if it exists but does not have an =, or + * the content to the right of the = until the first space (or end of + *

Re: [PATCH 3/4] connect: learn to parse capabilities with values

2012-08-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: +/* + * Parse features of the form feature=value. Returns NULL if the feature + * does not exist, the empty string if it exists but does not have an =, or + * the content to the right of the = until the first space (or end of + * string). The cannot contain

Re: [PATCH 3/4] connect: learn to parse capabilities with values

2012-08-10 Thread Jeff King
On Fri, Aug 10, 2012 at 01:01:11PM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: +/* + * Parse features of the form feature=value. Returns NULL if the feature + * does not exist, the empty string if it exists but does not have an =, or + * the content to the right of

Re: [PATCH 3/4] connect: learn to parse capabilities with values

2012-08-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: I would think the extra memory allocation would dwarf it, anyway. ... and a new caller can do something like agent = server_supports(agent); if (!agent || !agent[5]) ... no agent ... else { int span =