cabinet: Include wine/port.h for strcasecmp().

Francois Gouget fgouget at free.fr
Fri Feb 1 05:05:17 CST 2008



"Bang Jun-young" <junyoung at mogua.com> wrote:

>> > cabinet: Include wine/port.h for strcasecmp().
>>
>> If a Wine DLL uses strcasecmp() then it's a bug. It should
>> use an appropriate kernel32 API instead.
> 
> I know, but it's too late. The tree is already contaminated with such
> functions and quite a number of other unnecessary Wine-specific APIs
> which shouldn't have been in the first place.

The situation is not all that bad. I count only 158 references to 
strcasecmp(). So reviewing and fixing those that are wrong seems quite 
feasible and would make a good janitorial task.

The rules are as follows:

 * For case insensitive comparisons of 'windows strings', a Windows 
   function must be used (stricmp() or similar).
 * For case insensitive comparisons of 'Unix strings', that is of 
   strings coming from the Unix world such as Unix filenames, then using 
   strcasecmp() is fine. However, in the Unix world it's not very common 
   to want to do case insensitive comparisons.
 * Comparing a 'windows string' with a unix one is out altogether 
   (whether case insensitive or not) because they may not even be in the 
   same encoding.


-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
     Linux, WinNT, MS-DOS - also known as the Good, the Bad and the Ugly.



More information about the wine-devel mailing list