diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-14 12:30:11 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-14 12:30:11 +0300 |
commit | e21fc45beaf3d6abcb012ffecb796e5053e8e5ac (patch) | |
tree | f25394033cb4a96378399d3f8a2a1b92390262d2 /utilities.cpp | |
parent | ce5c8cbc5632891613ccd653d81deb3742c932a7 (diff) |
modified: gpg_wrapper.cpp
modified: main.cpp
modified: new_gpg.vcproj
modified: options.cpp
modified: utilities.cpp
modified: utilities.h
Diffstat (limited to 'utilities.cpp')
-rw-r--r-- | utilities.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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;
+}
|