diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2021-05-27 23:37:23 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2021-05-27 23:37:23 +0200 |
commit | df1df2929646abd77955b80e3ded3574ac005179 (patch) | |
tree | 9704901455843d41180a9402ed4c0012a1d67f04 /src/net.c | |
parent | 68c20667ca775a4d4a7d1cfc3c9ec5c30f275084 (diff) | |
download | polecat-df1df2929646abd77955b80e3ded3574ac005179.tar.gz polecat-df1df2929646abd77955b80e3ded3574ac005179.zip |
allow flags to exit prematurely, move defines, add no networking flag
Diffstat (limited to 'src/net.c')
-rw-r--r-- | src/net.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -44,6 +44,8 @@ static inline int xferinfo(UNUSED void *p, curl_off_t dltotal, curl_off_t dlnow, struct MemoryStruct* downloadToRam(const char* URL, int progress) { + if (no_net) return NULL; + CURL* curl_handle; CURLcode res = CURLE_OK; @@ -138,6 +140,10 @@ struct json_object* fetchJSON(const char* URL) free(chunk->memory); free(chunk); } + else if (isatty(STDERR_FILENO)) + { + fprintf(stderr, "Couldn't fetch JSON\n"); + } return json; } |