From 0dfc53b0c3fe5c99c53873430bb0093e930a46f1 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 16 Jun 2009 09:55:45 +0000 Subject: [PATCH] state: bugfix in the package version selector --- src/state.c | 7 +++++-- 1 file 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];