X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Furl.c;h=dbd19a82713711dd80393bda81f9d89e9c23b22e;hp=857aada5aa415f9699be9abae5bcb1784a49a1cb;hb=1cddc05edb952ed0077704b954d753f737e6e53c;hpb=d8c9ce30aaefe1b89ba611ca91d72a2285395610 diff --git a/src/url.c b/src/url.c index 857aada5..dbd19a82 100644 --- a/src/url.c +++ b/src/url.c @@ -1577,6 +1577,14 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return) } } +typedef struct _downloaded_file_list { + char* file; + downloaded_file_t download_type; + struct _downloaded_file_list* next; +} downloaded_file_list; + +static downloaded_file_list *downloaded_files; + /* Remembers which files have been downloaded. In the standard case, should be called with mode == FILE_DOWNLOADED_NORMALLY for each file we actually download successfully (i.e. not for ones we have failures on or that we skip @@ -1592,15 +1600,7 @@ write_backup_file (const char *file, downloaded_file_t downloaded_file_return) downloaded_file_t downloaded_file (downloaded_file_t mode, const char* file) { - typedef struct _downloaded_file_list - { - char* file; - downloaded_file_t download_type; - struct _downloaded_file_list* next; - } downloaded_file_list; - boolean found_file = FALSE; - static downloaded_file_list* downloaded_files = NULL; downloaded_file_list* rover = downloaded_files; while (rover != NULL) @@ -1628,6 +1628,19 @@ downloaded_file (downloaded_file_t mode, const char* file) return FILE_NOT_ALREADY_DOWNLOADED; } } + +void +downloaded_files_free (void) +{ + downloaded_file_list* rover = downloaded_files; + while (rover) + { + downloaded_file_list *next = rover->next; + xfree (rover->file); + xfree (rover); + rover = next; + } +} /* Initialization of static stuff. */ void