1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
18 #include "inspircd_config.h"
20 #include "inspstring.h"
22 void Delete(char* str,int pos)
25 strlcpy(moo,str,MAXBUF);
27 strlcpy(str,moo,MAXBUF);
28 strlcat(str,moo+pos+1,MAXBUF);
31 void Insert(char* substr,char* str,int pos)
35 strlcpy(str,a.c_str(),MAXBUF);
41 bool match2(char* literal,char* mask)
50 if ((strstr(mask,"*")==0) && (strlen(literal) != strlen(mask)))
54 while (I < strlen(mask))
56 if (I2 >= strlen(literal))
59 if ((mask[I]=='*') && (MWC==0))
61 strlcpy(OldM,mask,MAXBUF);
65 while (strlen(mask)<255)
73 strlcpy(mask,OldM,MAXBUF);
83 if (mask[I] != literal[I2])
90 if (strlen(literal)==strlen(mask))
95 bool match(const char* literal, const char* mask)
100 strlcpy(L,literal,10240);
101 strlcpy(M,mask,10240);
104 // short circuit literals
105 log(DEBUG,"Match '%s' to '%s'",L,M);
106 if ((!strchr(M,'*')) && (!strchr(M,'?')))
108 if (!strcasecmp(L,M))