From e21fc45beaf3d6abcb012ffecb796e5053e8e5ac Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 14 Sep 2010 12:30:11 +0300 Subject: modified: gpg_wrapper.cpp modified: main.cpp modified: new_gpg.vcproj modified: options.cpp modified: utilities.cpp modified: utilities.h --- utilities.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index 9c07b89..649b4e1 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -584,3 +584,22 @@ bool isContactHaveKey(HANDLE hContact) return false; } +#define NEWTSTR_MALLOC(A) (A==NULL)?NULL:strcpy((char*)mir_alloc(sizeof(char)*(strlen(A)+1)),A) + +const bool StriStr(const char *str, const char *substr) +{ + bool i = false; + char *str_up = NEWTSTR_MALLOC(str); + char *substr_up = NEWTSTR_MALLOC(substr); + + CharUpperBuffA(str_up, strlen(str_up)); + CharUpperBuffA(substr_up, strlen(substr_up)); + + if(strstr (str_up, substr_up)) + i = true; + + mir_free(str_up); + mir_free(substr_up); + + return i; +} -- cgit v1.2.3