diff options
author | Nick White <git@njw.me.uk> | 2014-02-25 09:57:10 +0000 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2014-02-25 09:57:10 +0000 |
commit | 0093be6c652640c336128cfca50fe28a85b90fa6 (patch) | |
tree | a99e1c7f821a940f3002dbc5a305cc342ce83ac0 | |
parent | 5b396d8aafe49251d178ec0310009e924b834ecb (diff) |
Don't redownload pages if they've been specified on stdin
-rw-r--r-- | getgbook.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -244,6 +244,12 @@ int main(int argc, char *argv[]) fprintf(stderr, "%s not found\n", in); continue; } + snprintf(pgpath, STRMAX, "%s/%04d.png", bookdir, pages[i]->num); + snprintf(pgpath2, STRMAX, "%s/%04d.jpg", bookdir, pages[i]->num); + if((f = fopen(pgpath, "r")) != NULL || (f = fopen(pgpath2, "r")) != NULL) { + fclose(f); + continue; + } searchpage(pages[i]); getpage(pages[i]); } |