Additionally search for non-regex strings on a db search operation

This closes out FS#6500 and covers cases where the package names contain regex
characters (i.e. the case of dvd+rw-tools)

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
Aaron Griffin 2007-11-15 00:07:31 -06:00 committed by Dan McGee
parent 7af1f66441
commit c7879e77a7
1 changed files with 4 additions and 0 deletions

View File

@ -507,6 +507,10 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
if (regexec(&reg, alpm_pkg_get_name(pkg), 0, 0, 0) == 0) {
matched = alpm_pkg_get_name(pkg);
}
/* check plain text name */
else if (strstr(alpm_pkg_get_name(pkg), targ)) {
matched = alpm_pkg_get_name(pkg);
}
/* check desc */
else if (regexec(&reg, alpm_pkg_get_desc(pkg), 0, 0, 0) == 0) {
matched = alpm_pkg_get_desc(pkg);