Improve String_contains_i to allow for multiple terms

This enables:
* Multiple filters in the main panel and strace etc. views
* Multiple search terms

The search terms are separated by "|" and are still fixed strings
matched case-insensitive.

Added a multi flag at request of BenBE.
This commit is contained in:
Daniel Lange
2022-03-25 16:24:24 +01:00
parent a2ca7583a9
commit 7c43e02591
7 changed files with 28 additions and 11 deletions

View File

@ -394,7 +394,7 @@ void ProcessList_rebuildPanel(ProcessList* this) {
if ( (!p->show)
|| (this->userId != (uid_t) -1 && (p->st_uid != this->userId))
|| (incFilter && !(String_contains_i(Process_getCommand(p), incFilter)))
|| (incFilter && !(String_contains_i(Process_getCommand(p), incFilter, true)))
|| (this->pidMatchList && !Hashtable_get(this->pidMatchList, p->tgid)) )
continue;