https://gitlab.synchro.net/main/sbbs/-/commit/a19d58c10ef5c874e6fb7320
Modified Files:
src/sbbs3/findstr.c findstr.h mailsrvr.c qwk.cpp sbbsecho.c userdat.c Log Message:
New findstr functions that can search for (up to) two strings in one go
Many searches are done (e.g. in the mail server, QWK import) for either of 2 strings in single file or list, so let's optimize that to a single iteration through the file/list. This should reduce some redundant file I/O.
I do find this API a little confusing with the filename or list at the end
of the argument list, but kept it consistent with the existing single string findstr functions (which are now just wrappers for the new 2-string flavors).
I noticed during this update that findstr() did not share the same behavior
as findstr_in_list() (feature added in commit f08f2137) whereby if all the patterns were negative searches (beginning with '!'), then *all* the
negative matches would have to be successful (not just the first) for the function to return true. So now findstr() behaves like findstr_in_list()
in this regard.
I also added some optimizations to findstr_in_string().
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net