See Bruno Haible's comment in <http://bugs.gnu.org/10305#120>.
* lib/regcomp.c (init_dfa): Use just ASCII case comparison
for codeset name.
* lib/regex_internal.h: Do not include <strings.h>, since we
no longer use strcasecmp.
* modules/regex (Depends-on): Remove strcase.
+2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ regex: use locale-independent comparison for codeset name
+ See Bruno Haible's comment in <http://bugs.gnu.org/10305#120>.
+ * lib/regcomp.c (init_dfa): Use just ASCII case comparison
+ for codeset name.
+ * lib/regex_internal.h: Do not include <strings.h>, since we
+ no longer use strcasecmp.
+ * modules/regex (Depends-on): Remove strcase.
+
2012-06-23 Bruno Haible <bruno@clisp.org>
getopt-posix: No longer guarantee that option processing is resettable.
!= 0);
#else
codeset_name = nl_langinfo (CODESET);
- if (strcasecmp (codeset_name, "UTF-8") == 0
- || strcasecmp (codeset_name, "UTF8") == 0)
+ if ((codeset_name[0] == 'U' || codeset_name[0] == 'u')
+ && (codeset_name[1] == 'T' || codeset_name[1] == 't')
+ && (codeset_name[2] == 'F' || codeset_name[2] == 'f')
+ && strcmp (codeset_name + 3 + (codeset_name[3] == '-'), "8") == 0)
dfa->is_utf8 = 1;
/* We check exhaustively in the loop below if this charset is a
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <strings.h>
#include <langinfo.h>
#ifndef _LIBC
nl_langinfo [test $ac_use_included_regex = yes]
stdbool [test $ac_use_included_regex = yes]
stdint [test $ac_use_included_regex = yes]
-strcase [test $ac_use_included_regex = yes]
wchar [test $ac_use_included_regex = yes]
wcrtomb [test $ac_use_included_regex = yes]
wctype-h [test $ac_use_included_regex = yes]