libopkg: fix unsatisfied dependency reporting
authorJo-Philipp Wich <jo@mein.io>
Wed, 15 Feb 2017 22:39:47 +0000 (23:39 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 16:02:29 +0000 (17:02 +0100)
Previous refactoring of pkg_hash_fetch_unsatisfied_dependencies() caused the
outermost loop counter variable to not get incremented anymore, causing the
function to always report the first dependency as unsatisifed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/pkg_depends.c

index b2e0df0..a12b313 100644 (file)
@@ -90,7 +90,7 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t * unsatisfied,
        the_lost = NULL;
 
        /* foreach dependency */
        the_lost = NULL;
 
        /* foreach dependency */
-       for (; compound_depend && compound_depend->type; compound_depend++) {
+       for (i = 0; compound_depend && compound_depend->type; compound_depend++, i++) {
                depend_t **possible_satisfiers =
                    compound_depend->possibilities;;
                found = 0;
                depend_t **possible_satisfiers =
                    compound_depend->possibilities;;
                found = 0;