From: Xavier Saint Date: Thu, 7 Aug 2008 08:27:19 +0000 (+0200) Subject: Automated merge. X-Git-Tag: v1.13~338^2~7^2~6 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=44a22c78a76e6733dd4d420a236be0963f00f4c5 Automated merge. --- 44a22c78a76e6733dd4d420a236be0963f00f4c5 diff --cc doc/ChangeLog index cea5f7b5,08d2f05e..94a06283 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@@ -1,8 -1,12 +1,17 @@@ + 2008-08-03 Xavier Saint + + * wget.texi : Add option descriptions for the three new + options --iri, --locale and --remote-encoding related to + IRI support. + + * sample.wgetrc : Add commented lines for the three new + command iri, locale and encoding related to IRI support. + +2008-08-03 Micah Cowan + + * wget.texi: Don't set UPDATED; already set by version.texi. + (HTTP Options): Add --default-page option. + 2008-07-17 Steven Schubiger * wget.texi (Logging and Input File Options): Document diff --cc src/html-url.c index 95df8bf9,6e886083..cbaffb25 --- a/src/html-url.c +++ b/src/html-url.c @@@ -726,14 -753,12 +753,14 @@@ get_urls_file (const char *file url_text = merged; } - url = url_parse (url_text, &up_error_code); + url = url_parse (url_text, &up_error_code, NULL); if (!url) { + char *error = url_error (url_text, up_error_code); logprintf (LOG_NOTQUIET, _("%s: Invalid URL %s: %s\n"), - file, url_text, url_error (up_error_code)); + file, url_text, error); xfree (url_text); + xfree (error); continue; } xfree (url_text); diff --cc src/recur.c index 741ca823,71fbe7bf..119896ce --- a/src/recur.c +++ b/src/recur.c @@@ -192,13 -199,15 +199,16 @@@ retrieve_tree (const char *start_url struct hash_table *blacklist; int up_error_code; - struct url *start_url_parsed = url_parse (start_url, &up_error_code); + struct url *start_url_parsed; + struct iri *i = iri_new (); + set_uri_encoding (i, opt.locale, true); + start_url_parsed = url_parse (start_url, &up_error_code, i); if (!start_url_parsed) { - logprintf (LOG_NOTQUIET, "%s: %s.\n", start_url, - url_error (up_error_code)); + char *error = url_error (start_url, up_error_code); + logprintf (LOG_NOTQUIET, "%s: %s.\n", start_url, error); + xfree (error); return URLERROR; } diff --cc src/retr.c index 85774297,fe176eaf..c79410ff --- a/src/retr.c +++ b/src/retr.c @@@ -625,13 -625,12 +625,14 @@@ retrieve_url (const char *origurl, cha if (file) *file = NULL; - u = url_parse (url, &up_error_code); + second_try: + u = url_parse (url, &up_error_code, iri); if (!u) { - logprintf (LOG_NOTQUIET, "%s: %s.\n", url, url_error (up_error_code)); + char *error = url_error (url, up_error_code); + logprintf (LOG_NOTQUIET, "%s: %s.\n", url, error); xfree (url); + xfree (error); return URLERROR; } @@@ -648,15 -651,18 +653,20 @@@ proxy = getproxy (u); if (proxy) { + /* sXXXav : could a proxy include a path ??? */ + struct iri *pi = iri_new (); + set_uri_encoding (pi, opt.locale, true); + pi->utf8_encode = false; + /* Parse the proxy URL. */ - proxy_url = url_parse (proxy, &up_error_code); + proxy_url = url_parse (proxy, &up_error_code, NULL); if (!proxy_url) { + char *error = url_error (proxy, up_error_code); logprintf (LOG_NOTQUIET, _("Error parsing proxy URL %s: %s.\n"), - proxy, url_error (up_error_code)); + proxy, error); xfree (url); + xfree (error); RESTORE_POST_DATA; return PROXERR; } @@@ -726,13 -732,17 +736,18 @@@ xfree (mynewloc); mynewloc = construced_newloc; + /* Reset UTF-8 encoding state, keep the URI encoding and reset + the content encoding. */ + iri->utf8_encode = opt.enable_iri; + set_content_encoding (iri, NULL); + /* Now, see if this new location makes sense. */ - newloc_parsed = url_parse (mynewloc, &up_error_code); + newloc_parsed = url_parse (mynewloc, &up_error_code, iri); if (!newloc_parsed) { + char *error = url_error (mynewloc, up_error_code); logprintf (LOG_NOTQUIET, "%s: %s.\n", escnonprint_uri (mynewloc), - url_error (up_error_code)); + error); url_free (u); xfree (url); xfree (mynewloc); diff --cc src/url.h index ce308f6f,9c49c0b5..69db1551 --- a/src/url.h +++ b/src/url.h @@@ -84,8 -84,8 +84,8 @@@ struct ur char *url_escape (const char *); - struct url *url_parse (const char *, int *); - char *url_error (const char *, int); + struct url *url_parse (const char *, int *, struct iri *iri); -const char *url_error (int); ++const char *url_error (const char *, int); char *url_full_path (const struct url *); void url_set_dir (struct url *, const char *); void url_set_file (struct url *, const char *);