summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/string.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/string.cc b/src/lib/string.cc
index bbd079d..a302fc6 100644
--- a/src/lib/string.cc
+++ b/src/lib/string.cc
@@ -69,3 +69,16 @@ int strcmp(const char *s1, const char *s2)
}
return *(const unsigned char *)s1 - *(const unsigned char *)s2;
}
+
+int strcasecmp(const char *s1, const char *s2)
+{
+ while (*s1)
+ {
+ if(*s1 == *s2 || *s1 + 32 == *s2 || *s1 == *s2 + 32){
+ s1++;
+ s2++;
+ }
+ else break;
+ }
+ return *(const unsigned char *)s1 - *(const unsigned char *)s2;
+} \ No newline at end of file