From: Howard Chu Date: Thu, 22 May 2003 23:22:22 +0000 (+0000) Subject: EBCDIC case for env open X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~73 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8def82e94d1d5aaa709fa097390355bf75c22a92;p=openldap EBCDIC case for env open --- diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index a464cd0f9b..9c2764b1e3 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -225,6 +225,9 @@ DB_ENV *ldbm_initialize_env(const char *home, int dbcachesize, int *envdirok) DB_ENV *env = NULL; int err; u_int32_t envFlags; +#ifdef HAVE_EBCDIC + char n2[2048]; +#endif err = db_env_create( &env, 0 ); @@ -259,6 +262,12 @@ DB_ENV *ldbm_initialize_env(const char *home, int dbcachesize, int *envdirok) envFlags |= DB_THREAD; #endif +#ifdef HAVE_EBCDIC + strncpy(n2, home, sizeof(n2)-1); + n2[sizeof(n2)-1] = '\0'; + __atoe(n2); + home = n2; +#endif #if DB_VERSION_X >= 0x030100 err = env->open( env, home, envFlags, 0 ); #else