summaryrefslogtreecommitdiff
path: root/iconv/iconv_open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-11-29 05:00:56 +0000
committerUlrich Drepper <drepper@redhat.com>2001-11-29 05:00:56 +0000
commite0e86ccb1d2848678b5c32f65bf6239ba5fb9d24 (patch)
treed2db260a028fd346925bdc815e3774d3b6135666 /iconv/iconv_open.c
parentc6baa867d3d57ca3eb89226b44ad696960d869cd (diff)
Update.
* iconv/gconv_open.c (__gconv_open): Empty codeset name now means using the current locale's codeset. * iconv/iconv_open.c (iconv_open): Don't strip out everything for empty input string. * iconv/iconv_prog.c: Pass empty strings as default value for to- and from-charset. Don't determine locale's charset here. if libio is used [PR libc/2575].
Diffstat (limited to 'iconv/iconv_open.c')
-rw-r--r--iconv/iconv_open.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/iconv/iconv_open.c b/iconv/iconv_open.c
index ac44af80cb..e0f6135575 100644
--- a/iconv/iconv_open.c
+++ b/iconv/iconv_open.c
@@ -40,14 +40,15 @@ iconv_open (const char *tocode, const char *fromcode)
/* Normalize the name. We remove all characters beside alpha-numeric,
'_', '-', '/', and '.'. */
tocode_len = strlen (tocode);
- tocode_conv = alloca (tocode_len + 3);
+ tocode_conv = (char *) alloca (tocode_len + 3);
strip (tocode_conv, tocode);
- tocode = tocode_conv[2] == '\0' ? upstr (tocode_conv, tocode) : tocode_conv;
+ tocode = (tocode_conv[2] == '\0' && tocode[0] != '\0'
+ ? upstr (tocode_conv, tocode) : tocode_conv);
fromcode_len = strlen (fromcode);
- fromcode_conv = alloca (fromcode_len + 3);
+ fromcode_conv = (char *) alloca (fromcode_len + 3);
strip (fromcode_conv, fromcode);
- fromcode = (fromcode_conv[2] == '\0'
+ fromcode = (fromcode_conv[2] == '\0' && fromcode[0] != '\0'
? upstr (fromcode_conv, fromcode) : fromcode_conv);
res = __gconv_open (tocode, fromcode, &cd, 0);