diff --git a/qpkg/prereq.c b/qpkg/prereq.c index 841aedf..c503d9d 100644 --- a/qpkg/prereq.c +++ b/qpkg/prereq.c @@ -183,18 +183,11 @@ static void resolve(struct list *next_dep, const struct ref *dep, continue; push(pkg); more_deps.refs = pkg->depends; - if (next_dep) { - more_deps.next = next_dep->next; - next_dep->next = &more_deps; - } else { - more_deps.next = NULL; - } + more_deps.next = next_dep; more_conf.refs = pkg->conflicts; more_conf.next = conf; - resolve(next_dep ? next_dep : &more_deps, dep->next, - &more_conf); - if (next_dep) - next_dep->next = more_deps.next; + resolve(&more_deps, dep->next, &more_conf); + next_dep = more_deps.next; pop(); } }