summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-06-16 09:55:45 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-06-16 09:55:45 +0000
commit0dfc53b0c3fe5c99c53873430bb0093e930a46f1 (patch)
tree9691b2006d6d8b864201efa0811f6d4ab947cda8 /src
parent49c904c993d39cfac7d3373c66f5b910e755f203 (diff)
downloadapk-tools-0dfc53b0c3fe5c99c53873430bb0093e930a46f1.tar.gz
apk-tools-0dfc53b0c3fe5c99c53873430bb0093e930a46f1.tar.bz2
apk-tools-0dfc53b0c3fe5c99c53873430bb0093e930a46f1.tar.xz
apk-tools-0dfc53b0c3fe5c99c53873430bb0093e930a46f1.zip
state: bugfix in the package version selector
Diffstat (limited to 'src')
-rw-r--r--src/state.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c
index 9d6e9a8..17e9913 100644
--- a/src/state.c
+++ b/src/state.c
@@ -201,11 +201,14 @@ int apk_state_lock_dependency(struct apk_state *state,
/* Multiple candidates: prune incompatible versions. */
c = ns_to_choices(state->name[name->id]);
- for (i = 0; i < c->num; i++) {
+ i = 0;
+ while (i < c->num) {
if (apk_version_compare(APK_BLOB_STR(c->pkgs[i]->version),
APK_BLOB_STR(dep->version))
- & dep->result_mask)
+ & dep->result_mask) {
+ i++;
continue;
+ }
c = name_choices_writable(c);
c->pkgs[i] = c->pkgs[c->num - 1];