index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-08-17 16:45:35 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-17 17:30:41 -0500 |
commit | 9cddc4ad80dbb52e30cdbcd168a4c19b73e30bbe (patch) | |
tree | 8c9db6092fb018a10bb86733559489ad91b23424 | |
parent | 3ceef97799da9ec938dbade9e08e624ebb5fcea7 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 14 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 9f1285d0..fd5c9289 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -385,12 +385,16 @@ cleanup: } if(ret == 0) { - if(rename(tempfile, destfile)) { - _alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), - tempfile, destfile, strerror(errno)); - ret = -1; + if (destfile) { + if(rename(tempfile, destfile)) { + _alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), + tempfile, destfile, strerror(errno)); + ret = -1; + } else if(final_file) { + *final_file = strdup(strrchr(destfile, '/') + 1); + } } else if(final_file) { - *final_file = strdup(strrchr(destfile, '/') + 1); + *final_file = strdup(strrchr(tempfile, '/') + 1); } } |