summaryrefslogtreecommitdiff
path: root/missing/strcasecmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing/strcasecmp.c')
-rw-r--r--missing/strcasecmp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/missing/strcasecmp.c b/missing/strcasecmp.c
new file mode 100644
index 0000000..83aa50d
--- /dev/null
+++ b/missing/strcasecmp.c
@@ -0,0 +1,13 @@
+#include <ctype.h>
+
+#define min(a,b) (((a)>(b))?(b):(a))
+int
+strcasecmp(p1, p2)
+ char *p1, *p2;
+{
+ for ( ; *p1 && *p2; p1++, p2++) {
+ if (toupper(*p1) != toupper(*p2))
+ return toupper(*p1) - toupper(*p2);
+ }
+ return strlen(p1) - strlen(p2);
+}