aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-03-11 07:46:09 +0000
committerSteve Holme <steve_holme@hotmail.com>2016-03-11 07:46:09 +0000
commit06ccaa0c68eba7d16531a00620724d4b1170ecdd (patch)
treefd51bbab9165c0b3066c2cba904b060a1bc732a7 /lib
parent58e4a067430a8f9187155f50e117dc3150595dd5 (diff)
url: Corrected indentation when calling idna_to_ascii_lz()
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/lib/url.c b/lib/url.c
index 0894bae8b..d165d9c0a 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3775,33 +3775,29 @@ static void fix_hostname(struct SessionHandle *data,
there's no use for it */
host->name[len-1]=0;
+ /* Check name for non-ASCII and convert hostname to ACE form if we can */
if(!is_ASCII_name(host->name)) {
#ifdef USE_LIBIDN
- /*************************************************************
- * Check name for non-ASCII and convert hostname to ACE form.
- *************************************************************/
- if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
- char *ace_hostname = NULL;
- int rc = idna_to_ascii_lz(host->name, &ace_hostname, 0);
- infof (data, "Input domain encoded as `%s'\n",
- stringprep_locale_charset ());
- if(rc != IDNA_SUCCESS)
- infof(data, "Failed to convert %s to ACE; %s\n",
- host->name, Curl_idn_strerror(conn, rc));
- else {
- /* tld_check_name() displays a warning if the host name contains
- "illegal" characters for this TLD */
- (void)tld_check_name(data, ace_hostname);
-
- host->encalloc = ace_hostname;
- /* change the name pointer to point to the encoded hostname */
- host->name = host->encalloc;
+ if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+ char *ace_hostname = NULL;
+
+ int rc = idna_to_ascii_lz(host->name, &ace_hostname, 0);
+ infof(data, "Input domain encoded as `%s'\n",
+ stringprep_locale_charset());
+ if(rc == IDNA_SUCCESS) {
+ /* tld_check_name() displays a warning if the host name contains
+ "illegal" characters for this TLD */
+ (void)tld_check_name(data, ace_hostname);
+
+ host->encalloc = ace_hostname;
+ /* change the name pointer to point to the encoded hostname */
+ host->name = host->encalloc;
+ }
+ else
+ infof(data, "Failed to convert %s to ACE; %s\n", host->name,
+ Curl_idn_strerror(conn, rc));
}
- }
#elif defined(USE_WIN32_IDN)
- /*************************************************************
- * Check name for non-ASCII and convert hostname to ACE form.
- *************************************************************/
char *ace_hostname = NULL;
if(curl_win32_idn_to_ascii(host->name, &ace_hostname)) {