From 0e5f1d12d155bbc97139851fa1a3762352978dd3 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 27 Nov 2005 03:18:43 +0000 Subject: [PATCH] A few fixes to get the emailnot plugin to work properly. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1602 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- plugins/plugin.h | 1 + plugins/qvm_api.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/plugins/plugin.h b/plugins/plugin.h index 65e17a911..a3e1e5426 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -22,6 +22,7 @@ void *malloc(int size); void free(void *mem); char *strstr(char *str, const char *sub); void strlcpy(char *d, const char *s, int n); +char *strchr(char *str, char sub); #else diff --git a/plugins/qvm_api.c b/plugins/qvm_api.c index 6b1e13a4d..d6e9c51aa 100644 --- a/plugins/qvm_api.c +++ b/plugins/qvm_api.c @@ -261,12 +261,60 @@ int strncmp (const char *s1, const char *s2, int count) return -1; } +int strnicmp(const char *s1, const char *s2, int count) +{ + char c1, c2; + char ct; + while(*s1) + { + if (!count--) + return 0; + c1 = *s1; + c2 = *s2; + if (c1 != c2) + { + if (c1 >= 'a' && c1 <= 'z') c1 = c1-'a' + 'A'; + if (c2 >= 'a' && c2 <= 'z') c2 = c2-'a' + 'A'; + if (c1 != c2) + return c1= 'a' && c1 <= 'z') c1 = c1-'a' + 'A'; + if (c2 >= 'a' && c2 <= 'z') c2 = c2-'a' + 'A'; + if (c1 != c2) + return c1