summaryrefslogtreecommitdiff
path: root/lib/iconv_open.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-12-15 20:14:02 +0100
committerLudovic Courtès <ludo@gnu.org>2009-12-15 20:14:19 +0100
commit1cd4fffcde4edd4853e039da9a42e0972d851a51 (patch)
tree82c1f750fd5acf88414b85a421c7b7212d9efcfc /lib/iconv_open.c
parent20ccae8dbb8d92a6a32e0275c517f70961c6b833 (diff)
downloadguile-1cd4fffcde4edd4853e039da9a42e0972d851a51.tar.gz
Use Gnulib's `sys_stat' module; update Gnulib.
* .x-sc_prohibit_S_IS_definition: New file. * m4/gnulib-cache.m4: Add `sys_stat'. * libguile/filesys.c: Remove `S_IS*' macro definitions for Ultrix and MinGW.
Diffstat (limited to 'lib/iconv_open.c')
-rw-r--r--lib/iconv_open.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/lib/iconv_open.c b/lib/iconv_open.c
index a17df2dda..d62dfda34 100644
--- a/lib/iconv_open.c
+++ b/lib/iconv_open.c
@@ -67,33 +67,33 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
&& fromcode[3] == '-')
{
if (c_toupper (tocode[0]) == 'U'
- && c_toupper (tocode[1]) == 'T'
- && c_toupper (tocode[2]) == 'F'
- && tocode[3] == '-')
- {
- if (strcmp (fromcode + 4, "8") == 0)
- {
- if (c_strcasecmp (tocode + 4, "16BE") == 0)
- return _ICONV_UTF8_UTF16BE;
- if (c_strcasecmp (tocode + 4, "16LE") == 0)
- return _ICONV_UTF8_UTF16LE;
- if (c_strcasecmp (tocode + 4, "32BE") == 0)
- return _ICONV_UTF8_UTF32BE;
- if (c_strcasecmp (tocode + 4, "32LE") == 0)
- return _ICONV_UTF8_UTF32LE;
- }
- else if (strcmp (tocode + 4, "8") == 0)
- {
- if (c_strcasecmp (fromcode + 4, "16BE") == 0)
- return _ICONV_UTF16BE_UTF8;
- if (c_strcasecmp (fromcode + 4, "16LE") == 0)
- return _ICONV_UTF16LE_UTF8;
- if (c_strcasecmp (fromcode + 4, "32BE") == 0)
- return _ICONV_UTF32BE_UTF8;
- if (c_strcasecmp (fromcode + 4, "32LE") == 0)
- return _ICONV_UTF32LE_UTF8;
- }
- }
+ && c_toupper (tocode[1]) == 'T'
+ && c_toupper (tocode[2]) == 'F'
+ && tocode[3] == '-')
+ {
+ if (strcmp (fromcode + 4, "8") == 0)
+ {
+ if (c_strcasecmp (tocode + 4, "16BE") == 0)
+ return _ICONV_UTF8_UTF16BE;
+ if (c_strcasecmp (tocode + 4, "16LE") == 0)
+ return _ICONV_UTF8_UTF16LE;
+ if (c_strcasecmp (tocode + 4, "32BE") == 0)
+ return _ICONV_UTF8_UTF32BE;
+ if (c_strcasecmp (tocode + 4, "32LE") == 0)
+ return _ICONV_UTF8_UTF32LE;
+ }
+ else if (strcmp (tocode + 4, "8") == 0)
+ {
+ if (c_strcasecmp (fromcode + 4, "16BE") == 0)
+ return _ICONV_UTF16BE_UTF8;
+ if (c_strcasecmp (fromcode + 4, "16LE") == 0)
+ return _ICONV_UTF16LE_UTF8;
+ if (c_strcasecmp (fromcode + 4, "32BE") == 0)
+ return _ICONV_UTF32BE_UTF8;
+ if (c_strcasecmp (fromcode + 4, "32LE") == 0)
+ return _ICONV_UTF32LE_UTF8;
+ }
+ }
}
#endif
@@ -116,20 +116,20 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
/* Convert the encodings to upper case, because
1. in the arguments of iconv_open() on AIX, HP-UX, and OSF/1 the case
- matters,
+ matters,
2. it makes searching in the table faster. */
{
const char *p = fromcode;
char *q = fromcode_upper;
while ((*q = c_toupper (*p)) != '\0')
{
- p++;
- q++;
- if (q == &fromcode_upper[SIZEOF (fromcode_upper)])
- {
- errno = EINVAL;
- return (iconv_t)(-1);
- }
+ p++;
+ q++;
+ if (q == &fromcode_upper[SIZEOF (fromcode_upper)])
+ {
+ errno = EINVAL;
+ return (iconv_t)(-1);
+ }
}
fromcode_upper_end = q;
}
@@ -139,13 +139,13 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
char *q = tocode_upper;
while ((*q = c_toupper (*p)) != '\0')
{
- p++;
- q++;
- if (q == &tocode_upper[SIZEOF (tocode_upper)])
- {
- errno = EINVAL;
- return (iconv_t)(-1);
- }
+ p++;
+ q++;
+ if (q == &tocode_upper[SIZEOF (tocode_upper)])
+ {
+ errno = EINVAL;
+ return (iconv_t)(-1);
+ }
}
tocode_upper_end = q;
}