summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-08-17 23:57:47 +0200
committerDan McGee <dan@archlinux.org>2011-08-18 00:31:04 +0200
commit2dbdfe078847dc1247db77580655b387f746ba28 (patch)
tree62441ee43dd525f96fb41c019b995adc1b5f2cab /lib
parentb9833838c673b2c86a7073e50522af483d7f01dd (diff)
downloadpacman-2dbdfe078847dc1247db77580655b387f746ba28.tar.gz
pacman-2dbdfe078847dc1247db77580655b387f746ba28.tar.xz
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/dload.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 357544bb..0cd0bf7b 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -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