/* Conversion of links to local files.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003-2005 Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with Wget; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+along with Wget; if not, write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
free_urlpos (urls);
}
- secs = ptimer_measure (timer) / 1000;
+ secs = ptimer_measure (timer);
ptimer_destroy (timer);
- logprintf (LOG_VERBOSE, _("Converted %d files in %.*f seconds.\n"),
- file_count, secs < 10 ? 3 : 1, secs);
+ logprintf (LOG_VERBOSE, _("Converted %d files in %s seconds.\n"),
+ file_count, print_decimal (secs));
}
static void write_backup_file (const char *, downloaded_file_t);
static void
dissociate_urls_from_file (const char *file)
{
- hash_table_map (dl_url_file_map, dissociate_urls_from_file_mapper,
- (char *)file);
+ /* Can't use hash_table_iter_* because the table mutates while mapping. */
+ hash_table_for_each (dl_url_file_map, dissociate_urls_from_file_mapper,
+ (char *) file);
}
/* Register that URL has been successfully downloaded to FILE. This
return FILE_NOT_ALREADY_DOWNLOADED;
}
-static int
-df_free_mapper (void *key, void *value, void *ignored)
-{
- xfree (key);
- return 0;
-}
-
static void
downloaded_files_free (void)
{
if (downloaded_files_hash)
{
- hash_table_map (downloaded_files_hash, df_free_mapper, NULL);
+ hash_table_iterator iter;
+ for (hash_table_iterate (downloaded_files_hash, &iter);
+ hash_table_iter_next (&iter);
+ )
+ xfree (iter.key);
hash_table_destroy (downloaded_files_hash);
downloaded_files_hash = NULL;
}