From f08f2137e3ead0635e4e937856e353a7624fe4a8 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Thu, 19 Mar 2009 07:28:02 +0000 Subject: [PATCH] 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. --- src/sbbs3/str_util.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/str_util.c b/src/sbbs3/str_util.c index df8ea79742..6ce8de3bd8 100644 --- a/src/sbbs3/str_util.c +++ b/src/sbbs3/str_util.c @@ -196,12 +196,18 @@ BOOL DLLCALL findstr_in_list(const char* insearchof, str_list_t list) { size_t index; BOOL found=FALSE; + char* p; if(list==NULL || insearchof==NULL) return(FALSE); - for(index=0;list[index]!=NULL && !found; index++) - found=findstr_in_string(insearchof, list[index]); + for(index=0; list[index]!=NULL; index++) { + p=list[index]; + SKIP_WHITESPACE(p); + found=findstr_in_string(insearchof,p); + if(found!=(*p=='!')) + break; + } return(found); } -- GitLab