Re: [PATCH v14 04/13] ref-filter: implement an `align` atom
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Sep 1, 2015, 15:13 UTC
- Message-ID
- <CAOLa=ZQfHViZa15SD-PZOr_AZqAEnN9RJ9ouPhUoEMUfSd56Gw@mail.gmail.com>
- In-Reply-To
- <vpqk2sa1dyp.fsf@anie.imag.fr>
On Tue, Sep 1, 2015 at 6:41 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 20 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>> Like this:
>>
>> else if (skip_prefix(name, "align", &valp)) {
>> struct align *align = &v->u.align;
>> struct strbuf **s;
>>
>> if (valp[0] != ':')
>> die(_("format: usage %%(align:<width>,<position>)"));
>> else
>> valp++;
>> ......
>> ........
>> }
>
> Checking the string's correctness as you read it seems good to me, yes.
>
> But as you say, you should make this a bit more generic, for example by
> putting your "if/else" in a helper function, that other atoms could use.Okay then, I'll keep that in mind :)
-- Regards, Karthik Nayak