Skip to content
Snippets Groups Projects
Commit f08f2137 authored by rswindell's avatar rswindell
Browse files

findstr_in_list() improvement - if each search string/expression in the list

is a negative search (i.e. begins with '!'), then every string must match
for the function to return TRUE.
parent 104299dc
No related branches found
No related tags found
No related merge requests found
...@@ -196,12 +196,18 @@ BOOL DLLCALL findstr_in_list(const char* insearchof, str_list_t list) ...@@ -196,12 +196,18 @@ BOOL DLLCALL findstr_in_list(const char* insearchof, str_list_t list)
{ {
size_t index; size_t index;
BOOL found=FALSE; BOOL found=FALSE;
char* p;
if(list==NULL || insearchof==NULL) if(list==NULL || insearchof==NULL)
return(FALSE); return(FALSE);
for(index=0;list[index]!=NULL && !found; index++) for(index=0; list[index]!=NULL; index++) {
found=findstr_in_string(insearchof, list[index]); p=list[index];
SKIP_WHITESPACE(p);
found=findstr_in_string(insearchof,p);
if(found!=(*p=='!'))
break;
}
return(found); return(found);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment