summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-04-01 19:42:36 +0000
committerJeremy Allison <jra@samba.org>2004-04-01 19:42:36 +0000
commit37dd5e52f61e7ba1facb726ac70fc75e22608103 (patch)
tree44f01ccf84cfd82c9359c734d1e0d75d79e09e5c /source/lib
parent1aeeb432c75eeb67e9e1323932b37d34da416d37 (diff)
downloadsamba-37dd5e52f61e7ba1facb726ac70fc75e22608103.tar.gz
samba-37dd5e52f61e7ba1facb726ac70fc75e22608103.tar.xz
samba-37dd5e52f61e7ba1facb726ac70fc75e22608103.zip
"Fixing my FORTRAN". Ensure we always have some valid char converter for the
neccessary types before we will run at all. If we can't get one, use ASCII but complain mightily. Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/charcnv.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c
index 11b1448f1eb..b9791931a35 100644
--- a/source/lib/charcnv.c
+++ b/source/lib/charcnv.c
@@ -130,9 +130,21 @@ void init_iconv(void)
conv_handles[c1][c2] = smb_iconv_open(n2,n1);
if (conv_handles[c1][c2] == (smb_iconv_t)-1) {
- DEBUG(0,("Conversion from %s to %s not supported\n",
+ DEBUG(0,("init_iconv: Conversion from %s to %s not supported\n",
charset_name((charset_t)c1), charset_name((charset_t)c2)));
- conv_handles[c1][c2] = NULL;
+ if (c1 != CH_UCS2) {
+ n1 = "ASCII";
+ }
+ if (c2 != CH_UCS2) {
+ n2 = "ASCII";
+ }
+ DEBUG(0,("init_iconv: Attempting to replace with conversion from %s to %s\n",
+ n1, n2 ));
+ conv_handles[c1][c2] = smb_iconv_open(n2,n1);
+ if (!conv_handles[c1][c2]) {
+ DEBUG(0,("init_iconv: Conversion from %s to %s failed", n1, n2));
+ smb_panic("init_iconv: conv_handle initialization failed.");
+ }
}
}
}
@@ -477,8 +489,6 @@ size_t convert_string_allocate(TALLOC_CTX *ctx, charset_t from, charset_t to,
if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
if (!conv_silent)
DEBUG(0,("convert_string_allocate: Conversion not supported.\n"));
- if (allow_bad_conv)
- goto use_as_is;
return (size_t)-1;
}