Skip to content

Commit

Permalink
Fix search by maintainer
Browse files Browse the repository at this point in the history
Fixes #130
  • Loading branch information
f2404 committed Jul 30, 2016
1 parent 4b10ff4 commit 730d217
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/aur.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,15 +657,19 @@ static unsigned int aur_request_search (alpm_list_t **targets, CURL *curl)
for (const alpm_list_t *p = pkgs; p; p = alpm_list_next (p)) {
bool match = true;
const aurpkg_t *pkg = p->data;
const char *pkgname = aur_pkg_get_string_value (pkg, AUR_NAME);
const char *pkgdesc = aur_pkg_get_string_value (pkg, AUR_DESCRIPTION);
for (const alpm_list_t *t = *targets; t; t = alpm_list_next (t)) {
if (strcasestr (pkgname, t->data) == NULL &&
(!pkgdesc || strcasestr (pkgdesc, t->data) == NULL)) {
match = false;
break;

if (!config.aur_maintainer) {
const char *pkgname = aur_pkg_get_string_value (pkg, AUR_NAME);
const char *pkgdesc = aur_pkg_get_string_value (pkg, AUR_DESCRIPTION);
for (const alpm_list_t *t = *targets; t; t = alpm_list_next (t)) {
if (strcasestr (pkgname, t->data) == NULL &&
(!pkgdesc || strcasestr (pkgdesc, t->data) == NULL)) {
match = false;
break;
}
}
}

if (match) {
pkgs_found++;
print_or_add_result (pkg, R_AUR_PKG);
Expand Down

0 comments on commit 730d217

Please sign in to comment.