Re: [PATCH v12 01/13] ref-filter: move `struct atom_value` to ref-filter.c
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Aug 19, 2015, 15:29 UTC
- Message-ID
- <CAOLa=ZTuhUfXmqQdmGJ2u=5js23akgQWprDUWZYNJsd+=ncw5A@mail.gmail.com>
- In-Reply-To
- <vpqy4h72up1.fsf@anie.imag.fr>
On Wed, Aug 19, 2015 at 8:26 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 14 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>> +static void end_atom_handler(struct atom_value *atomv, struct ref_formatting_state **state)
>> +{
>> + struct ref_formatting_state *current = *state;
>> + if (!current->at_end)
>> + die(_("format: `end` atom used without a supporting atom"));
>
> You error out on %(end) without %(align), but not on %(align) without
> %(end).
>
> You should probably check that the stack is empty at the end and error
> out otherwise.
>You're right,
if (state->prev)
die(_("format: `end` atom missing"));should do before printing.
-- Regards, Karthik Nayak