X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fconvert.c;h=71e3d8f03a4346a96565152158d55a43c4f18951;hp=4f90bb3b062c17662ad53b3f260eeeb34cb8703c;hb=d763f8bf6d6e13ce006ffab616cc8a77e747a633;hpb=caae3b70f46bd519857b595f7f06ea0179551336 diff --git a/src/convert.c b/src/convert.c index 4f90bb3b..71e3d8f0 100644 --- a/src/convert.c +++ b/src/convert.c @@ -73,7 +73,7 @@ convert_links_in_hashtable (struct hash_table *downloaded_set, if (downloaded_set) cnt = hash_table_count (downloaded_set); if (cnt == 0) - goto cleanup; + return; file_array = alloca_array (char *, cnt); string_set_to_array (downloaded_set, file_array); @@ -96,7 +96,7 @@ convert_links_in_hashtable (struct hash_table *downloaded_set, /* Parse the file... */ urls = is_css ? get_urls_css_file (file, url) : - get_urls_html (file, url, NULL); + get_urls_html (file, url, NULL, NULL); /* We don't respect meta_disallow_follow here because, even if the file is not followed, we might still want to convert the @@ -184,7 +184,7 @@ convert_all_links (void) secs = ptimer_measure (timer); logprintf (LOG_VERBOSE, _("Converted %d files in %s seconds.\n"), file_count, print_decimal (secs)); -cleanup: + ptimer_destroy (timer); } @@ -246,8 +246,8 @@ convert_links (const char *file, struct urlpos *links) zeroes from the mmaped region. */ if (unlink (file) < 0 && errno != ENOENT) { - logprintf (LOG_NOTQUIET, _("Unable to delete `%s': %s\n"), - file, strerror (errno)); + logprintf (LOG_NOTQUIET, _("Unable to delete %s: %s\n"), + quote (file), strerror (errno)); read_file_free (fm); return; } @@ -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,7 +591,7 @@ 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 @@ -627,7 +628,7 @@ local_quote_string (const char *file) *to++ = '3'; break; case '?': - if (opt.html_extension) + if (opt.adjust_extension) { *to++ = '%'; *to++ = '3';