clean up strequal()?

Simo Sorce simo.sorce at xsec.it
Wed Apr 9 08:16:28 GMT 2003


I'm for a rename.
We should make functions functionalities an requirements as self evident
as possible to avoid being fooled into introducing bugs in samba.

Simo.

On Wed, 2003-04-09 at 07:30, Martin Pool wrote:
> After a conversation with tridge this morning:
> 
> The strequal() function in Samba is a relic of an older version where
> case sensitivity was a configurable parameter.  
> 
> >From its name you might expect it to be defined as (strcmp(a,b)==0),
> which is done in some other programs.  However, rather surprisingly,
> it is in fact equal to (StrCaseCmp(a,b) == 0).  
> 
> This seems like a bit of a trap:
> 
>  - People are likely to call it when they actually want a
>    case-sensitive conversion.
> 
>  - Because of the way Unicode is supported, doing case-insensitive
>    comparisons is much more expensive than a regular strcmp.  We may
>    be paying this price when it's not needed.
> 
> It seems like a more consistent name would be strcaseequal_m().
> 
> I'm inclined to either rename it, or go through and check the callers.
> 
> Comments?
-- 
Simo Sorce - simo.sorce at xsec.it
Xsec s.r.l. - http://www.xsec.it
via Durando 10 Ed. G - 20158 - Milano
mobile: +39 329 328 7702
tel. +39 02 2399 7130 - fax: +39 02 700 442 399
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20030409/a9d79220/attachment.bin


More information about the samba-technical mailing list