On Tue, Sep 23, 2014 at 11:29 AM, Paul Belanger <
[email protected]> wrote:

> On Tue, Sep 23, 2014 at 11:45 AM, George Joseph
> <[email protected]> wrote:
> > I've been working on some changes for config.c and in the process I've
> found
> > 5 instances of someone attempting to do "cat->name == category_name"
> instead
> > of "strcmp(cat->name, category_name)".    Example:
> >
> > /* try exact match first, then case-insensitive match */
> > for (cat = config->root; cat; cat = cat->next) {
> > if (cat->name == category_name && (ignored || !cat->ignored))
> > return cat;
> > }
> >
> > for (cat = config->root; cat; cat = cat->next) {
> > if (!strcasecmp(cat->name, category_name) && (ignored || !cat->ignored))
> > return cat;
> > }
> >
> > The result is that the case sensitive match never succeeds and it's
> always
> > the case insensitive match that's run.
> >
> > My question is...  Should I fix these so the case sensitive match works
> and
> > runs first or just remove the first loop so the match is always
> > case-insensitive?   I'm hoping the latter not only because it makes the
> code
> > simpler but because that's how it's worked for years and suddenly making
> the
> > match case sensitive might cause unexpected problems.
> >
> > Thoughts?
> >
> For me, case sensitive.  Because I config files that do have:
>
> [Foo]
>
> [foo]
>
> [fOO]
>
> don't ask, long story.
>
>
And it currently works? :-D

(Just kidding)

If that is the case, then obviously any change we make here should be done
to trunk only.

I'll leave the impending case-war to others... :-)

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to