1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

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

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) { if (regexec(&reg, alpm_pkg_get_name(pkg), 0, 0, 0) == 0) {
matched = alpm_pkg_get_name(pkg); 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 */ /* check desc */
else if (regexec(&reg, alpm_pkg_get_desc(pkg), 0, 0, 0) == 0) { else if (regexec(&reg, alpm_pkg_get_desc(pkg), 0, 0, 0) == 0) {
matched = alpm_pkg_get_desc(pkg); matched = alpm_pkg_get_desc(pkg);