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

Search message tags as well as body-text and subjects when searching for

text.
Use strcasestr() for message body/header-field text searches (simplify
the code) - not sure why we needed strip_ctrl(), so removed.
parent 0e9d120a
No related branches found
No related tags found
No related merge requests found
......@@ -494,7 +494,6 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
{
char str[256],str2[256],do_find=true,mismatches=0
,done=0,domsg=1,*buf,*p;
char subj[128];
char find_buf[128];
char tmp[128];
int i;
......@@ -752,11 +751,8 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
domsg=0;
continue;
}
strupr(buf);
strip_ctrl(buf, buf);
SAFECOPY(subj,msg.subj);
strupr(subj);
if(!strstr(buf,find) && !strstr(subj,find)) {
if(strcasestr(buf,find) == NULL && strcasestr(msg.subj, find) == NULL
&& (msg.tags == NULL || strcasestr(msg.tags, find) == NULL)) {
free(buf);
if(smb.curmsg<smb.msgs-1)
smb.curmsg++;
......@@ -1702,7 +1698,6 @@ long sbbs_t::searchposts(uint subnum, post_t *post, long start, long posts
, const char *search)
{
char* buf;
char subj[128];
long l,found=0;
smbmsg_t msg;
......@@ -1717,11 +1712,8 @@ long sbbs_t::searchposts(uint subnum, post_t *post, long start, long posts
smb_freemsgmem(&msg);
continue;
}
strupr(buf);
strip_ctrl(buf, buf);
SAFECOPY(subj,msg.subj);
strupr(subj);
if(strstr(buf,search) || strstr(subj,search)) {
if(strcasestr(buf, search) != NULL || strcasestr(msg.subj, search) != NULL
|| (msg.tags != NULL && strcasestr(msg.tags, search) != NULL)) {
if(!found)
bputs(text[MailOnSystemLstHdr]);
bprintf(text[SubMsgLstFmt],l+1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment