From 77adf4cd648dce41f89469dd185deec6b6b53a0b Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Wed, 18 Feb 2009 17:36:07 +0530 Subject: Added all files --- argp-standalone/strcasecmp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 argp-standalone/strcasecmp.c (limited to 'argp-standalone/strcasecmp.c') diff --git a/argp-standalone/strcasecmp.c b/argp-standalone/strcasecmp.c new file mode 100644 index 00000000000..bcad7a2268e --- /dev/null +++ b/argp-standalone/strcasecmp.c @@ -0,0 +1,28 @@ +/* strcasecmp.c + * + */ + +/* Written by Niels Möller + * + * This file is hereby placed in the public domain. + */ + +#include + +int strcasecmp(const char *s1, const char *s2) +{ + unsigned i; + + for (i = 0; s1[i] && s2[i]; i++) + { + unsigned char c1 = tolower( (unsigned char) s1[i]); + unsigned char c2 = tolower( (unsigned char) s2[i]); + + if (c1 < c2) + return -1; + else if (c1 > c2) + return 1; + } + + return !s2[i] - !s1[i]; +} -- cgit