Brings pacman -Sl behavior in line with other listing operations.

Signed-off-by: Andrew Gregory <[email protected]>
---
 src/pacman/sync.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 2093029..f8af176 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -503,12 +503,15 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t 
*targets)
                        if(db == NULL) {
                                pm_printf(ALPM_LOG_ERROR,
                                        _("repository \"%s\" was not 
found.\n"), repo);
-                               alpm_list_free(ls);
-                               return 1;
                        }
 
                        ls = alpm_list_add(ls, db);
                }
+
+               if(!ls) {
+                       /* all of our targets were invalid */
+                       return 1;
+               }
        } else {
                ls = syncs;
        }
-- 
1.8.3


Reply via email to