![Guy Harris](/assets/img/avatar_default.png)
est. Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our own versions if they're missing from GLib (as is the case with GLib 1.x). In the code to build the list of named fields for Diameter, don't use g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping in the hash function and use g_ascii_strcasecmp() in the compare function. We do this because there is no guarantee that toupper(), tolower(), and functions that use them will, for example, map between "I" and "i" in all locales; in Turkish locales, for example, there are, in both upper case and lower case, versions of "i" with and without a dot, and the upper-case version of "i" is "I"-with-a-dot and the lower-case version of "I" is "i"-without-a-dot. This causes strings that should match not to match. This finishes fixing bug 2010 - an earlier checkin prevented the crash (as there are other ways to produce the same crash, e.g. a bogus dictionary.xml file), but didn't fix the case-insensitive string matching. svn path=/trunk/; revision=23623
19 lines
417 B
C
19 lines
417 B
C
/*
|
|
* $Id$
|
|
*
|
|
* "g_ascii_strcasecmp()" and "g_ascii_strncasecmp()" extracted from
|
|
* GLib 2.4.8, for use with GLibs that don't have it (e.g., GLib 1.2[.x]).
|
|
*/
|
|
|
|
#ifndef __WIRESHARK_G_ASCII_STRCASECMP_H__
|
|
#define __WIRESHARK_G_ASCII_STRCASECMP_H__
|
|
|
|
extern gint g_ascii_strcasecmp (const gchar *s1,
|
|
const gchar *s2);
|
|
|
|
extern gint g_ascii_strncasecmp (const gchar *s1,
|
|
const gchar *s2,
|
|
gsize n);
|
|
|
|
#endif
|