diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-04-09 07:05:02 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-04-09 07:05:02 +0300 |
commit | 538114978d33f6695227fdc3066e83051a99e615 (patch) | |
tree | 65bf94b111cc8203a659bf9ae71c4f8bfc4dd7d0 /utilities.cpp | |
parent | 8df2a03d555d4359185344774d20016ec4709308 (diff) |
url in uath requests blockint (test)
Diffstat (limited to 'utilities.cpp')
-rw-r--r-- | utilities.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/utilities.cpp b/utilities.cpp index 4d3b3cf..bf61929 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -144,12 +144,12 @@ tstring variables_parse(tstring const &tstrFormat, HANDLE hContact){ return tstrFormat; } -// case-insensitive _tcsstr +// case-insensitive _tcscmp //by nullbie as i remember... #define NEWTSTR_MALLOC(A) (A==NULL)?NULL:_tcscpy((TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(A)+1)),A) const int Stricmp(const TCHAR *str, const TCHAR *substr) { - int i; + int i = 0; TCHAR *str_up = NEWTSTR_MALLOC(str); TCHAR *substr_up = NEWTSTR_MALLOC(substr); @@ -164,3 +164,20 @@ const int Stricmp(const TCHAR *str, const TCHAR *substr) return i; } +const int Stristr(const TCHAR *str, const TCHAR *substr) +{ + int i = 0; + TCHAR *str_up = NEWTSTR_MALLOC(str); + TCHAR *substr_up = NEWTSTR_MALLOC(substr); + + CharUpperBuff(str_up, lstrlen(str_up)); + CharUpperBuff(substr_up, lstrlen(substr_up)); + + if(_tcsstr (str_up, substr_up)) + i = 1; + + mir_free(str_up); + mir_free(substr_up); + + return i; +} |