1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-01 09:51:50 -05:00

lib/dload: avoid renaming download to 0 length destfile

This leverages earlier work that avoids a rename when destfile is unset.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dave Reisner 2011-08-17 17:57:47 -04:00 committed by Dan McGee
parent b9833838c6
commit 2dbdfe0788

View File

@ -362,7 +362,7 @@ static int curl_download_internal(struct dload_payload *payload,
destfile = get_fullpath(localpath, payload->cd_filename, "");
} else {
const char *effective_filename = strrchr(effective_url, '/');
if(effective_filename) {
if(effective_filename && strlen(effective_filename) > 2) {
effective_filename++;
/* if destfile was never set, we wrote to a tempfile. even if destfile is