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:
parent
b9833838c6
commit
2dbdfe0788
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user