"Bang Jun-young" junyoung@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.