]> sjero.net Git - wget/blobdiff - src/convert.c
Rename two functions.
[wget] / src / convert.c
index 280d1b0c819f4bd6c5833a8c30d48acaeffd89e6..fc858787f43fda92ebe7ce79572131eb8a0e434e 100644 (file)
@@ -1,6 +1,6 @@
 /* Conversion of links to local files.
-   Copyright (C) 2003, 2004, 2005, 2006, 2007,
-   2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+   Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -228,7 +228,7 @@ convert_links (const char *file, struct urlpos *links)
       }
   }
 
-  fm = read_file (file);
+  fm = wget_read_file (file);
   if (!fm)
     {
       logprintf (LOG_NOTQUIET, _("Cannot convert links in %s: %s\n"),
@@ -248,7 +248,7 @@ convert_links (const char *file, struct urlpos *links)
     {
       logprintf (LOG_NOTQUIET, _("Unable to delete %s: %s\n"),
                  quote (file), strerror (errno));
-      read_file_free (fm);
+      wget_read_file_free (fm);
       return;
     }
   /* Now open the file for writing.  */
@@ -257,7 +257,7 @@ convert_links (const char *file, struct urlpos *links)
     {
       logprintf (LOG_NOTQUIET, _("Cannot convert links in %s: %s\n"),
                  file, strerror (errno));
-      read_file_free (fm);
+      wget_read_file_free (fm);
       return;
     }
 
@@ -342,7 +342,7 @@ convert_links (const char *file, struct urlpos *links)
   if (p - fm->content < fm->length)
     fwrite (p, 1, fm->length - (p - fm->content), fp);
   fclose (fp);
-  read_file_free (fm);
+  wget_read_file_free (fm);
 
   logprintf (LOG_VERBOSE, "%d-%d\n", to_file_count, to_url_count);
 }
@@ -591,15 +591,15 @@ find_fragment (const char *beg, int size, const char **bp, const char **ep)
 
    We quote ? as %3F to avoid passing part of the file name as the
    parameter when browsing the converted file through HTTP.  However,
-   it is safe to do this only when `--html-extension' is turned on.
+   it is safe to do this only when `--adjust-extension' is turned on.
    This is because converting "index.html?foo=bar" to
    "index.html%3Ffoo=bar" would break local browsing, as the latter
    isn't even recognized as an HTML file!  However, converting
    "index.html?foo=bar.html" to "index.html%3Ffoo=bar.html" should be
    safe for both local and HTTP-served browsing.
 
-   We always quote "#" as "%23" and "%" as "%25" because those
-   characters have special meanings in URLs.  */
+   We always quote "#" as "%23", "%" as "%25" and ";" as "%3B"
+   because those characters have special meanings in URLs.  */
 
 static char *
 local_quote_string (const char *file)
@@ -607,7 +607,7 @@ local_quote_string (const char *file)
   const char *from;
   char *newname, *to;
 
-  char *any = strpbrk (file, "?#%");
+  char *any = strpbrk (file, "?#%;");
   if (!any)
     return html_quote_string (file);
 
@@ -627,8 +627,13 @@ local_quote_string (const char *file)
         *to++ = '2';
         *to++ = '3';
         break;
+      case ';':
+        *to++ = '%';
+        *to++ = '3';
+        *to++ = 'B';
+        break;
       case '?':
-        if (opt.html_extension)
+        if (opt.adjust_extension)
           {
             *to++ = '%';
             *to++ = '3';
@@ -913,7 +918,7 @@ static struct hash_table *downloaded_files_hash;
    However, our hash tables only accept pointers for keys and values.
    So when we need a pointer, we use the address of a
    downloaded_file_t variable of static storage.  */
-   
+
 static downloaded_file_t *
 downloaded_mode_to_ptr (downloaded_file_t mode)
 {