getht-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getht-commit] arch commit: getht--mainline--0.1--patch-18


From: Nick
Subject: [Getht-commit] arch commit: getht--mainline--0.1--patch-18
Date: Sun, 11 Mar 2007 01:35:13 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

Revision: getht--mainline--0.1--patch-18
Archive: address@hidden
Creator: Nick White <address@hidden>
Date: Sun Mar 11 01:34:48 GMT 2007
Standard-date: 2007-03-11 01:34:48 GMT
Modified-files: download.c issue.h tocxml.c
New-patches: address@hidden/getht--mainline--0.1--patch-18
Summary: Changed cover handling to same as section
Keywords: 

Cover is now just section 0.
Avoids unnecessary code duplication, and is no less functional.
M  download.c
M  issue.h
M  tocxml.c

* modified files

--- orig/download.c
+++ mod/download.c
@@ -161,25 +161,10 @@
                        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){


--- orig/issue.h
+++ mod/issue.h
@@ -19,7 +19,7 @@
  *
  */
 
-#define        SEC_NO  4
+#define        SEC_NO  5
 #define        ITEM_NO 30
 #define        MED_NO  2
 


--- orig/tocxml.c
+++ mod/tocxml.c
@@ -102,7 +102,7 @@
                                cnode = cnode->next;
                        }
                }
-       node = node->next;
+               node = node->next;
        }
 
        xmlFreeDoc(file);
@@ -128,12 +128,8 @@
        node = node->xmlChildrenNode;
 
        while(node != NULL){
-               if(!xmlStrcmp(node->name, (const xmlChar *) "cover"))
-               {
-                       cur_section = &(cur_issue->cover);
-                       parsesection(file, node, cur_section);
-               }
-               else if(!xmlStrncmp(node->name, (char *) "section",7))
+               if(!xmlStrncmp(node->name, (char *) "section",7) ||
+                       !xmlStrcmp(node->name, (const xmlChar *) "cover"))
                {
                        no_of_sections++;
                        cur_section = &(cur_issue->section[no_of_sections]);



Attachment: pgpHOdlLx5mMC.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]