summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2014-02-25 09:57:10 +0000
committerNick White <git@njw.me.uk>2014-02-25 09:57:10 +0000
commit0093be6c652640c336128cfca50fe28a85b90fa6 (patch)
treea99e1c7f821a940f3002dbc5a305cc342ce83ac0
parent5b396d8aafe49251d178ec0310009e924b834ecb (diff)
Don't redownload pages if they've been specified on stdin
-rw-r--r--getgbook.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/getgbook.c b/getgbook.c
index bc04a96..e6e15af 100644
--- a/getgbook.c
+++ b/getgbook.c
@@ -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]);
}