Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/dload.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index c8f52c48..98a7cf85 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -319,6 +319,10 @@ static int curl_download_internal(struct dload_payload *payload,
case CURLE_ABORTED_BY_CALLBACK:
goto cleanup;
default:
+ /* delete zero length downloads */
+ if(stat(tempfile, &st) == 0 && st.st_size == 0) {
+ payload->unlink_on_fail = 1;
+ }
if(!payload->errors_ok) {
handle->pm_errno = ALPM_ERR_LIBCURL;
_alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"),