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

Strip all ctrl chars and ctrl-a sequences from message buffer before comparing

for text searches.
The message subject is now converted to uppercase to compare case-
insensitively.
parent 34156430
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -346,6 +346,7 @@ 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;
......@@ -574,8 +575,11 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
domsg=0;
continue;
}
strupr((char *)buf);
if(!strstr((char *)buf,find) && !strstr(msg.subj,find)) {
strupr(buf);
strip_ctrl(buf);
SAFECOPY(subj,msg.subj);
strupr(subj);
if(!strstr(buf,find) && !strstr(subj,find)) {
free(buf);
if(smb.curmsg<smb.msgs-1)
smb.curmsg++;
......@@ -1171,7 +1175,8 @@ long sbbs_t::listsub(uint subnum, long mode, long start, const char* search)
long sbbs_t::searchposts(uint subnum, post_t *post, long start, long posts
, const char *search)
{
char *buf,ch;
char* buf,ch;
char subj[128];
long l,found=0;
smbmsg_t msg;
......@@ -1186,8 +1191,11 @@ long sbbs_t::searchposts(uint subnum, post_t *post, long start, long posts
smb_freemsgmem(&msg);
continue;
}
strupr((char *)buf);
if(strstr((char *)buf,search) || strstr(msg.subj,search)) {
strupr(buf);
strip_ctrl(buf);
SAFECOPY(subj,msg.subj);
strupr(subj);
if(strstr(buf,search) || strstr(subj,search)) {
if(!found)
CRLF;
if(msg.hdr.attr&MSG_DELETE)
......
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