summaryrefslogtreecommitdiffstats
path: root/String.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-01-14 00:21:37 -0200
committerHisham Muhammad <hisham@gobolinux.org>2014-01-14 00:21:37 -0200
commitcd692f27f4b88ac5abd12531536fab1d94eb607c (patch)
tree7cb361d17bb18379608f0b550a533bf612afc6c1 /String.c
parent7fd5e80429123d7ca35924b99e33b377a128be28 (diff)
There was a bug in my implementaion. No reason not to use the glibc version.
Diffstat (limited to 'String.c')
-rw-r--r--String.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/String.c b/String.c
index 173932ca..bd458e29 100644
--- a/String.c
+++ b/String.c
@@ -16,6 +16,7 @@ in the source distribution for its full text.
/*{
#define String_startsWith(s, match) (strstr((s), (match)) == (s))
+#define String_contains_i(s1, s2) (strcasestr(s1, s2) != NULL)
}*/
char* String_cat(const char* s1, const char* s2) {
@@ -91,17 +92,6 @@ void String_freeArray(char** s) {
free(s);
}
-int String_contains_i(const char* s, const char* match) {
- int lens = strlen(s);
- int lenmatch = strlen(match);
- for (int i = 0; i < lens-lenmatch; i++) {
- if (strncasecmp(s, match, strlen(match)) == 0)
- return 1;
- s++;
- }
- return 0;
-}
-
char* String_getToken(const char* line, const unsigned short int numMatch) {
const unsigned short int len = strlen(line);
char inWord = 0;

© 2014-2024 Faster IT GmbH | imprint | privacy policy