summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2000-05-16 03:59:15 +0000
committerJeff Trawick <trawick@apache.org>2000-05-16 03:59:15 +0000
commit12394ec1d5e047497fa6dfe01d9615f92a0b7f12 (patch)
tree7a04b0e788c587f4cb31c7af4d0bce91483a8bd1 /support
parent516688c8c280d7a7320af8cd7119eaf1f28b8031 (diff)
downloadhttpd-12394ec1d5e047497fa6dfe01d9615f92a0b7f12.tar.gz
EBCDIC bug fix: do the required translation handle initialization
so that ap_MD5Encode() can translate properly git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85227 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support')
-rw-r--r--support/htpasswd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/support/htpasswd.c b/support/htpasswd.c
index d7c95317b8..cff134d54f 100644
--- a/support/htpasswd.c
+++ b/support/htpasswd.c
@@ -377,6 +377,26 @@ int main(int argc, char *argv[])
int noninteractive = 0;
int i;
int args_left = 2;
+#ifdef CHARSET_EBCDIC
+ ap_pool_t *pool;
+ ap_status_t rv;
+ ap_xlate_t *to_ascii;
+
+ ap_initialize();
+ atexit(ap_terminate);
+ ap_create_pool(&pool, NULL);
+
+ rv = ap_xlate_open(&to_ascii, "ISO8859-1", APR_DEFAULT_CHARSET, pool);
+ if (rv) {
+ fprintf(stderr, "ap_xlate_open(to ASCII)->%d\n", rv);
+ exit(1);
+ }
+ rv = ap_MD5InitEBCDIC(to_ascii);
+ if (rv) {
+ fprintf(stderr, "ap_MD5InitEBCDIC()->%d\n", rv);
+ exit(1);
+ }
+#endif /*CHARSET_EBCDIC*/
tempfilename = NULL;
signal(SIGINT, (void (*)(int)) interrupted);