summaryrefslogtreecommitdiff
path: root/download.c
diff options
context:
space:
mode:
authorNick White <arch@njw.me.uk>2007-03-11 01:34:48 +0000
committerNick White <arch@njw.me.uk>2007-03-11 01:34:48 +0000
commitde890670aaab99edd839713d4185b77f6ba08d81 (patch)
tree8874cf9c1bbc3755ed642c58954355458797048b /download.c
parent5ba9d63365c8f5d7fb55459baec1a6b8df1e394c (diff)
Changed cover handling to same as section
Cover is now just section 0. Avoids unnecessary code duplication, and is no less functional. git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-18
Diffstat (limited to 'download.c')
-rw-r--r--download.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/download.c b/download.c
index 6e83afb..6c9ccae 100644
--- a/download.c
+++ b/download.c
@@ -161,25 +161,10 @@ void downloadissue(CURL *curl_handle, char * directory, iss * issue, int force)
scanf("%s", newdir); /* TODO: incorporate tab-completion */
}
- /* not reliable - workaround until malloc is completed */
- if(!strncmp(issue->cover.uri, "http://www.", 11))
- {
- snprintf(filename,STR_MAX,"%s/cover.pdf", newdir);
- if(!force){
- testfile = fopen(filename, "r");
- if(!testfile)
- save_file(curl_handle, issue->cover.uri, filename);
- else
- {
- fclose(testfile);
- printf("Skipping download of cover\n");
- }
- }
- else
- save_file(curl_handle, issue->cover.uri, filename);
- }
-
- for(cur_section = issue->section; cur_section->number>0 && cur_section->number<=SEC_NO; cur_section++)
+ int count;
+ for(cur_section = issue->section, count = 0;
+ count <= issue->no_of_sections;
+ cur_section++, count++)
{
snprintf(filename,STR_MAX,"%s/section_%i.pdf", newdir, cur_section->number);
if(!force){