<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 23, 2014 at 11:29 AM, Paul Belanger <span dir="ltr"><<a href="mailto:paul.belanger@polybeacon.com" target="_blank">paul.belanger@polybeacon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Sep 23, 2014 at 11:45 AM, George Joseph<br>
<<a href="mailto:george.joseph@fairview5.com">george.joseph@fairview5.com</a>> wrote:<br>
> I've been working on some changes for config.c and in the process I've found<br>
> 5 instances of someone attempting to do "cat->name == category_name" instead<br>
> of "strcmp(cat->name, category_name)".    Example:<br>
><br>
> /* try exact match first, then case-insensitive match */<br>
> for (cat = config->root; cat; cat = cat->next) {<br>
> if (cat->name == category_name && (ignored || !cat->ignored))<br>
> return cat;<br>
> }<br>
><br>
> for (cat = config->root; cat; cat = cat->next) {<br>
> if (!strcasecmp(cat->name, category_name) && (ignored || !cat->ignored))<br>
> return cat;<br>
> }<br>
><br>
> The result is that the case sensitive match never succeeds and it's always<br>
> the case insensitive match that's run.<br>
><br>
> My question is...  Should I fix these so the case sensitive match works and<br>
> runs first or just remove the first loop so the match is always<br>
> case-insensitive?   I'm hoping the latter not only because it makes the code<br>
> simpler but because that's how it's worked for years and suddenly making the<br>
> match case sensitive might cause unexpected problems.<br>
><br>
> Thoughts?<br>
><br>
</div></div>For me, case sensitive.  Because I config files that do have:<br>
<br>
[Foo]<br>
<br>
[foo]<br>
<br>
[fOO]<br>
<br>
don't ask, long story.<br>
<span class="HOEnZb"><font color="#888888"></font></span><br clear="all"></blockquote></div><br></div><div class="gmail_extra">And it currently works? :-D<br><br></div><div class="gmail_extra">(Just kidding)<br><br></div><div class="gmail_extra">If that is the case, then obviously any change we make here should be done to trunk only.<br><br>I'll leave the impending case-war to others... :-)<br></div><div class="gmail_extra"><br>-- <br><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div><div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div>
</div></div>