X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fconvert.c;h=61bbe6e2c26e580814801fef74bab544ce0b94f7;hp=54004ad08db3eb819d9a4ec427d2d82abb41d276;hb=4a08094db88011153adadbf995103770b20d2a31;hpb=ccd62071dcbdfc0269813746b9f51ff9c23261db diff --git a/src/convert.c b/src/convert.c index 54004ad0..61bbe6e2 100644 --- a/src/convert.c +++ b/src/convert.c @@ -1,6 +1,6 @@ /* Conversion of links to local files. Copyright (C) 2003, 2004, 2005, 2006, 2007, - 2008 Free Software Foundation, Inc. + 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Wget. @@ -420,7 +420,8 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return) /* Rather than just writing over the original .html file with the converted version, save the former to *.orig. Note we only do this for files we've _successfully_ downloaded, so we don't - clobber .orig files sitting around from previous invocations. */ + clobber .orig files sitting around from previous invocations. + On VMS, use "_orig" instead of ".orig". See "wget.h". */ /* Construct the backup filename as the original name plus ".orig". */ size_t filename_len = strlen (file); @@ -443,9 +444,9 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return) else /* downloaded_file_return == FILE_DOWNLOADED_NORMALLY */ { /* Append ".orig" to the name. */ - filename_plus_orig_suffix = alloca (filename_len + sizeof (".orig")); + filename_plus_orig_suffix = alloca (filename_len + sizeof (ORIG_SFX)); strcpy (filename_plus_orig_suffix, file); - strcpy (filename_plus_orig_suffix + filename_len, ".orig"); + strcpy (filename_plus_orig_suffix + filename_len, ORIG_SFX); } if (!converted_files) @@ -590,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) @@ -606,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); @@ -626,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'; @@ -912,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) {