1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-01-10 13:28:12 -05:00

upgrade.c: use iterator variable

remote was being used to loop over itself, making the FREELIST
ineffective.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2013-10-24 09:22:54 -04:00 committed by Allan McRae
parent c3493360af
commit d5acf7a44a

View File

@ -40,7 +40,7 @@
int pacman_upgrade(alpm_list_t *targets)
{
int retval = 0;
alpm_list_t *i, *remote = NULL;
alpm_list_t *i, *j, *remote = NULL;
if(targets == NULL) {
pm_printf(ALPM_LOG_ERROR, _("no targets specified (use -h for help)\n"));
@ -81,12 +81,12 @@ int pacman_upgrade(alpm_list_t *targets)
printf(_("loading packages...\n"));
/* add targets to the created transaction */
for(i = targets; i; i = alpm_list_next(i), remote = alpm_list_next(remote)) {
for(i = targets, j = remote; i; i = alpm_list_next(i), j = alpm_list_next(j)) {
const char *targ = i->data;
alpm_pkg_t *pkg;
alpm_siglevel_t level;
if(*(int *)remote->data) {
if(*(int *)j->data) {
level = alpm_option_get_remote_file_siglevel(config->handle);
} else {
level = alpm_option_get_local_file_siglevel(config->handle);