]> sjero.net Git - wget/commitdiff
Automated merge.
authorXavier Saint <wget@sxav.eu>
Thu, 7 Aug 2008 08:27:19 +0000 (10:27 +0200)
committerXavier Saint <wget@sxav.eu>
Thu, 7 Aug 2008 08:27:19 +0000 (10:27 +0200)
13 files changed:
1  2 
ChangeLog
doc/ChangeLog
doc/wget.texi
src/ChangeLog
src/build_info.c
src/html-url.c
src/init.c
src/main.c
src/options.h
src/recur.c
src/retr.c
src/url.c
src/url.h

diff --cc ChangeLog
Simple merge
diff --cc doc/ChangeLog
index cea5f7b51864a1c54512df6e476769bc0b8690ee,08d2f05e960df9bd9a83268b73154875039f8f1e..94a06283119c70de05857d0b2064a43ad83c6e01
@@@ -1,8 -1,12 +1,17 @@@
+ 2008-08-03  Xavier Saint  <wget@sxav.eu>
+       * 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  <micah@cowan.name>
 +
 +      * wget.texi: Don't set UPDATED; already set by version.texi.
 +      (HTTP Options): Add --default-page option.
 +
  2008-07-17  Steven Schubiger  <stsc@members.fsf.org>
  
        * wget.texi (Logging and Input File Options): Document
diff --cc doc/wget.texi
Simple merge
diff --cc src/ChangeLog
Simple merge
Simple merge
diff --cc src/html-url.c
index 95df8bf98e35b5d93b21da4003326fa5539b45f7,6e8860834338425ac3e9baa878b3d12300623a70..cbaffb25cb4550e3040fb2644663f566e40f4211
@@@ -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/init.c
Simple merge
diff --cc src/main.c
Simple merge
diff --cc src/options.h
Simple merge
diff --cc src/recur.c
index 741ca823094a75c0fd760f44cd126dba88e81216,71fbe7bf1f73767b47b105e44042cb6e81cb8c88..119896ce4431bbf1088951a57b8731e123b46f6c
@@@ -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 857742979e397748f3932d566d77ecf0d89dcd7b,fe176eafcfad22b5d539d2d82516c31d62d2b499..c79410ff893aa406a77cc3a10bb750464c8c0d3b
@@@ -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;
      }
  
    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;
          }
        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.c
Simple merge
diff --cc src/url.h
index ce308f6f97d815c624e85dd5ecc78a9300af83d6,9c49c0b5920ad91e3712bd5e88f9dd33f5da3cde..69db15510207488d7501fa8871ddb0d8389ebf63
+++ 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 *);