Re: [PATCH v5 04/14] trailer: process command line trailer arguments
- From
Christian Couder <chriscool@tuxfamily.org>
- Date
- Feb 9, 2014, 14:06 UTC
- Message-ID
- <20140209.150655.1495985026469658708.chriscool@tuxfamily.org>
- In-Reply-To
- <xmqqmwi3wzrb.fsf@gitster.dls.corp.google.com>
From: Junio C Hamano <gitster@pobox.com> Subject: Re: [PATCH v5 04/14] trailer: process command line trailer arguments Date: Thu, 06 Feb 2014 16:08:24 -0800
Show 22 quoted lines
> Christian Couder <chriscool@tuxfamily.org> writes:
>
>> This patch parses the trailer command line arguments
>> and put the result into an arg_tok doubly linked
>> list.
>
> No the patch doesn't parse anything ;-).
>
> "Parse the command line arguments and ...".
>
>> +static void parse_trailer(struct strbuf *tok, struct strbuf *val, const char *trailer)
>> +{
>> + const char *end = strchr(trailer, '=');
>> + if (!end)
>> + end = strchr(trailer, ':');
>
> How would you explain the behaviour of the above code for this
> input?
>
> frotz: nitfol=xyzzy
>
> Perhaps strcspn()?Ok to use strcspn().
Thanks, Christian.