diff options
author | Nick White <git@njw.me.uk> | 2012-02-25 12:02:09 +0000 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2012-02-25 12:02:09 +0000 |
commit | 6924eed5181a43989ca665f91908e50df4e1b4b0 (patch) | |
tree | 5c07f0d518c05e58f1595fb28107d29e0bf96262 /getgbook.c | |
parent | 4e6e2adeff8b4869de7c4c4fa0a5a3ab241d3a29 (diff) |
Don't re-download jpg images
Diffstat (limited to 'getgbook.c')
-rw-r--r-- | getgbook.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -168,7 +168,7 @@ int searchpage(Page *page) int main(int argc, char *argv[]) { char *tmp; - char buf[BUFSIZ], pgpath[STRMAX]; + char buf[BUFSIZ], pgpath[STRMAX], pgpath2[STRMAX]; char in[16]; int a, i, n; FILE *f; @@ -205,7 +205,8 @@ int main(int argc, char *argv[]) if(argc == 2) { for(i=0; i<numpages; i++) { snprintf(pgpath, STRMAX, "%s/%04d.png", bookdir, pages[i]->num); - if((f = fopen(pgpath, "r")) != NULL) { + snprintf(pgpath2, STRMAX, "%s/%04d.jpg", bookdir, pages[i]->num); + if((f = fopen(pgpath, "r")) != NULL || (f = fopen(pgpath2, "r")) != NULL) { fclose(f); continue; } |