Commit f2af8dfd authored by Howard Chu's avatar Howard Chu
Browse files

If HAVE_EBCDIC, translate dbname from ASCII to EBCDIC in ldbm_open.

parent b934eeb9
...@@ -304,6 +304,9 @@ LDBM ...@@ -304,6 +304,9 @@ LDBM
ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize ) ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
{ {
LDBM ret = NULL; LDBM ret = NULL;
#ifdef HAVE_EBCDIC
char n2[2048];
#endif
#if DB_VERSION_MAJOR >= 3 #if DB_VERSION_MAJOR >= 3
int err; int err;
...@@ -326,6 +329,12 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize ) ...@@ -326,6 +329,12 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
/* likely should use ber_mem* routines */ /* likely should use ber_mem* routines */
#ifdef HAVE_EBCDIC
strncpy(n2, name, sizeof(n2)-1);
n2[sizeof(n2)-1] = '\0';
__atoe(n2);
name = n2;
#endif
err = ret->open( ret, name, NULL, DB_TYPE, rw, mode); err = ret->open( ret, name, NULL, DB_TYPE, rw, mode);
if ( err != 0 ) { if ( err != 0 ) {
...@@ -604,6 +613,14 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize ) ...@@ -604,6 +613,14 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
#ifdef HAVE_ST_BLKSIZE #ifdef HAVE_ST_BLKSIZE
struct stat st; struct stat st;
#endif #endif
#ifdef HAVE_EBCDIC
char n2[2048];
strncpy(n2, name, sizeof(n2)-1);
n2[sizeof(n2)-1] = '\0';
__atoe(n2);
name = n2;
#endif
LDBM_WLOCK; LDBM_WLOCK;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment