From 0093be6c652640c336128cfca50fe28a85b90fa6 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 25 Feb 2014 09:57:10 +0000 Subject: Don't redownload pages if they've been specified on stdin --- getgbook.c | 6 ++++++ 1 file changed, 6 insertions(+) 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]); } -- cgit v1.2.3