Hi All,
There is no strcasestr() on MinGW Env.
So this patch comes.. Please review the attached one.
Sincerely,
Shinwoo Kim.
Index: src/lib/evil_string.c
===================================================================
--- src/lib/evil_string.c (revision 60564)
+++ src/lib/evil_string.c (working copy)
@@ -3,8 +3,8 @@
#endif /* HAVE_CONFIG_H */
#include "Evil.h"
+#include <ctype.h>
-
#ifdef _WIN32_WCE
/*
@@ -84,6 +84,31 @@
return ret;
}
+char *
+strcasestr (char *h, char *n)
+{
+ char *a, *e;
+ a = h;
+ e = n;
+
+ if (!h || !*h || !n ||!*n) return 0;
+ while (*a && *e)
+ {
+ if(toupper((unsigned char) *a) != toupper((unsigned char) *e))
+ {
+ ++h;
+ a = h;
+ e = n;
+ }
+ else
+ {
+ ++a;
+ ++e;
+ }
+ }
+ return *e ? 0 : h;
+}
+
#ifdef _MSC_VER
int strcasecmp(const char *s1, const char *s2)
Index: src/lib/evil_string.h
===================================================================
--- src/lib/evil_string.h (revision 60564)
+++ src/lib/evil_string.h (working copy)
@@ -103,6 +103,11 @@
*/
EAPI char *strrstr (const char *str, const char *substr);
+/**
+ * @brief Similar to 'strstr' but this function ignores the case of both strings.
+ */
+EAPI char *strcasestr (char *str, char *substr);
+
#ifdef _MSC_VER
EAPI int strcasecmp(const char *s1, const char *s2);
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel