Skip to content
Snippets Groups Projects
Commit 1e9b2b32 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add/use new trashcan2() function that'll compare 2 strings against a .can file

parent cfe2e836
No related branches found
No related tags found
No related merge requests found
Pipeline #4991 passed
......@@ -3119,8 +3119,7 @@ static bool smtp_client_thread(smtp_t* smtp)
return false;
}
if(trashcan(&scfg,host_name,"smtpspy")
|| trashcan(&scfg,host_ip,"smtpspy")) {
if(trashcan2(&scfg, host_ip, host_name, "smtpspy")) {
SAFECOPY(str, client.protocol);
strlwr(str);
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, str);
......@@ -4545,8 +4544,7 @@ static bool smtp_client_thread(smtp_t* smtp)
}
if(spy==NULL
&& (trashcan(&scfg,reverse_path,"smtpspy")
|| trashcan(&scfg,rcpt_addr,"smtpspy"))) {
&& trashcan2(&scfg,reverse_path, rcpt_addr, "smtpspy")) {
SAFECOPY(tmp, client.protocol);
strlwr(tmp);
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, tmp);
......
......@@ -73,6 +73,7 @@ DLLEXPORT BOOL is_valid_grpnum(scfg_t*, int);
DLLEXPORT BOOL is_valid_xtrnsec(scfg_t*, int);
DLLEXPORT BOOL trashcan(scfg_t* cfg, const char *insearch, const char *name);
DLLEXPORT BOOL trashcan2(scfg_t* cfg, const char* str1, const char* str2, const char *name);
DLLEXPORT char * trashcan_fname(scfg_t* cfg, const char *name, char* fname, size_t);
DLLEXPORT str_list_t trashcan_list(scfg_t* cfg, const char* name);
DLLEXPORT char * twitlist_fname(scfg_t* cfg, char* fname, size_t);
......
......@@ -888,6 +888,17 @@ BOOL trashcan(scfg_t* cfg, const char* insearchof, const char* name)
return(findstr(insearchof,trashcan_fname(cfg,name,fname,sizeof(fname))));
}
/****************************************************************************/
/* Searches the file <name>.can in the TEXT directory for 2 matches */
/* Returns TRUE if found in list, FALSE if not. */
/****************************************************************************/
BOOL trashcan2(scfg_t* cfg, const char* str1, const char* str2, const char* name)
{
char fname[MAX_PATH+1];
return find2strs(str1, str2, trashcan_fname(cfg,name,fname,sizeof(fname)));
}
/****************************************************************************/
char* trashcan_fname(scfg_t* cfg, const char* name, char* fname, size_t maxlen)
{
......
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