- /* specify locale */
- } else if ( strcasecmp( cargv[0], "locale" ) == 0 ) {
-#ifdef HAVE_LOCALE_H
- char *locale;
- if ( cargc < 2 ) {
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: missing locale in \"locale <name | on | off>\" line\n",
- fname, lineno, 0 );
- return( 1 );
- }
-
- locale = (strcasecmp( cargv[1], "on" ) == 0 ? ""
- : strcasecmp( cargv[1], "off" ) == 0 ? "C"
- : ch_strdup( cargv[1] ) );
-
- if ( setlocale( LC_CTYPE, locale ) == 0 ) {
- Debug( LDAP_DEBUG_ANY,
- (*locale
- ? "%s: line %d: bad locale \"%s\"\n"
- : "%s: line %d: bad locale\n"),
- fname, lineno, locale );
- return( 1 );
- }
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: \"locale\" unsupported\n",
- fname, lineno, 0 );
- return( 1 );
-#endif