summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--expac.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/expac.c b/expac.c
index e66f456..d2558a1 100644
--- a/expac.c
+++ b/expac.c
@@ -484,16 +484,14 @@ alpm_list_t *resolve_pkg(alpm_list_t *targets) {
char *pkgname, *reponame;
alpm_list_t *t, *r, *ret = NULL;
- if (search) {
- if (targets) {
- for (r = dblist; r; r = alpm_list_next(r)) {
- ret = alpm_list_join(ret, alpm_db_search(alpm_list_getdata(r), targets));
- }
- } else { /* dump full DBs */
- for (r = dblist; r; r = alpm_list_next(r)) {
- /* joining causes corruption on alpm_release(), so we copy */
- ret = alpm_list_join(ret, alpm_list_copy(alpm_db_get_pkgcache(alpm_list_getdata(r))));
- }
+ if (!targets) {
+ for (r = dblist; r; r = alpm_list_next(r)) {
+ /* joining causes corruption on alpm_release(), so we copy */
+ ret = alpm_list_join(ret, alpm_list_copy(alpm_db_get_pkgcache(alpm_list_getdata(r))));
+ }
+ } else if (search) {
+ for (r = dblist; r; r = alpm_list_next(r)) {
+ ret = alpm_list_join(ret, alpm_db_search(alpm_list_getdata(r), targets));
}
} else {
for (t = targets; t; t = alpm_list_next(t)) {