From e74ad0afa413066d61071461534274a2d3009378 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 10 Jul 2001 16:21:37 +0000
Subject: [PATCH] Added support for trashcan wildcards that people are more
 familiar with - i.e. a search string can now begin or end with a '*'.

---
 src/sbbs3/str.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/str.cpp b/src/sbbs3/str.cpp
index 690628ad9d..301ae11410 100644
--- a/src/sbbs3/str.cpp
+++ b/src/sbbs3/str.cpp
@@ -745,6 +745,7 @@ extern "C" BOOL DLLCALL trashcan(scfg_t* cfg, char* insearch, char* name)
 	char	str[128];
 	char	search[81];
 	int		c;
+	int		i;
 	BOOL	found;
 	FILE*	stream;
 
@@ -786,12 +787,20 @@ extern "C" BOOL DLLCALL trashcan(scfg_t* cfg, char* insearch, char* name)
 					found=!found; 
 			}
 
-			else if(p[c]=='^') {
+			else if(p[c]=='^' || p[c]=='*') {
 				p[c]=0;
 				if(!strncmp(p,search,c))
 					found=!found; 
 			}
 
+			else if(p[0]=='*') {
+				i=strlen(search);
+				if(i<c)
+					continue;
+				if(!strncmp(p+1,search+(i-c),c))
+					found=!found; 
+			}
+
 			else if(!strcmp(p,search))
 				found=!found; 
 		} 
-- 
GitLab