[pacman-dev] [PATCH 7/9] ini.c: move recursion limit to a macro

Andrew Gregory andrew.gregory.8 at gmail.com
Mon Jul 22 10:58:55 EDT 2013


On 07/22/13 at 08:41am, Dave Reisner wrote:
> On Jul 22, 2013 2:48 AM, "Andrew Gregory" <andrew.gregory.8 at gmail.com>
> wrote:
> >
> > Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
> > ---
> 
> OK... I'll bite. Why? Is this really going to be used elsewhere? Seems like
> an error case that should be handled by the like any other.

My goal wasn't reusability so much as visibility.  It's an artificial
limitation we impose to prevent memory exhaustion in a recursive call,
not a true error condition.  I also did this with the thought of
eventually trying to make the parser usable for pacman-related
programs outside of pacman proper and making the limit configurable.
I don't know if a macro is the best way to do that, though.

apg


More information about the pacman-dev mailing list