aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-11-27 18:52:51 +0000
committerGuy Harris <guy@alum.mit.edu>2007-11-27 18:52:51 +0000
commit9c89cdaaa3eccfe74d4e17705f38508c640b5047 (patch)
tree593646c7e1eb44302243659672c5fc691f0d4272 /configure.in
parenta189f34b84345d6851a489c484c01c1bf21f56d1 (diff)
strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
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
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 47974dd33e..350cbb0ff4 100644
--- a/configure.in
+++ b/configure.in
@@ -1314,6 +1314,28 @@ AC_SUBST(MKSTEMP_O)
ac_save_LIBS="$LIBS"
LIBS="$GLIB_LIBS $LIBS"
+G_ASCII_STRCASECMP_C=""
+G_ASCII_STRCASECMP_O=""
+G_ASCII_STRCASECMP_LO=""
+AC_CHECK_FUNC(g_ascii_strcasecmp,
+ [G_ASCII_STRCASECMP_O=""
+ G_ASCII_STRCASECMP_LO=""],
+ [G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
+ G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
+ AC_DEFINE(NEED_G_ASCII_STRCASECMP_H, 1, [Define if g_ascii_strcasecmp.h needs to be included])
+])
+LIBS="$ac_save_LIBS"
+if test "$ac_cv_func_g_ascii_strcasecmp" = no ; then
+ G_ASCII_STRCASECMP_C="g_ascii_strcasecmp.c"
+ G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
+ G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
+fi
+AC_SUBST(G_ASCII_STRCASECMP_C)
+AC_SUBST(G_ASCII_STRCASECMP_O)
+AC_SUBST(G_ASCII_STRCASECMP_LO)
+
+ac_save_LIBS="$LIBS"
+LIBS="$GLIB_LIBS $LIBS"
G_ASCII_STRTOULL_C=""
G_ASCII_STRTOULL_O=""
G_ASCII_STRTOULL_LO=""