Skip iconv() usage if HAVE_ICONV is not defined

This helps on broken iconv implementations, e.g. Solaris.

Reported-by: Mojca Miklavec
This commit is contained in:
Tim Rühsen 2017-04-18 13:17:19 +02:00
parent 67cb37ce5a
commit 0ec46cb109
2 changed files with 18 additions and 0 deletions

View File

@ -121,6 +121,7 @@ check_encoding_name (const char *encoding)
return true;
}
#ifdef HAVE_ICONV
/* Do the conversion according to the passed conversion descriptor cd. *out
will contain the transcoded string on success. *out content is
unspecified otherwise. */
@ -212,6 +213,15 @@ do_conversion (const char *tocode, const char *fromcode, char const *in_org, siz
}
return false;
}
#else
static bool
do_conversion (const char *tocode _GL_UNUSED, const char *fromcode _GL_UNUSED,
char const *in_org _GL_UNUSED, size_t inlen _GL_UNUSED, char **out)
{
*out = NULL;
return false;
}
#endif
/* Try converting string str from locale to UTF-8. Return a new string
on success, or str on error or if conversion isn't needed. */

View File

@ -1549,6 +1549,7 @@ append_uri_pathel (const char *b, const char *e, bool escaped,
append_null (dest);
}
#ifdef HAVE_ICONV
static char *
convert_fname (char *fname)
{
@ -1627,6 +1628,13 @@ convert_fname (char *fname)
return converted_fname;
}
#else
static char *
convert_fname (char *fname)
{
return fname;
}
#endif
/* Append to DEST the directory structure that corresponds the
directory part of URL's path. For example, if the URL is