1
0
Fork 0

Add emptiness check for `/url save` and `/plugins install`

Empty file is not a normal condition for file downloading,
thus user has to be notifed.

Related to https://github.com/profanity-im/profanity/issues/1901
This commit is contained in:
John Hernandez 2023-11-10 19:58:34 +01:00
parent 30fe5f0fb9
commit 092b5530b2
1 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,10 @@ http_file_get(void* userdata)
err = strdup(curl_easy_strerror(res));
}
if (ftell(outfh) == 0) {
err = strdup("Output file is empty.");
}
curl_easy_cleanup(curl);
curl_global_cleanup();