From 538114978d33f6695227fdc3066e83051a99e615 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 9 Apr 2010 07:05:02 +0300 Subject: url in uath requests blockint (test) --- utilities.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'utilities.cpp') 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; +} -- cgit v1.2.3