From fc00c656c96528112d05cf0edf8631bd5eaea446 Mon Sep 17 00:00:00 2001 From: Kacper Date: Sun, 7 Dec 2025 20:10:31 +0100 Subject: Add build system scaffolding and libc headers --- lib/libc/strings/strcasecmp.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/libc/strings/strcasecmp.c (limited to 'lib/libc/strings/strcasecmp.c') diff --git a/lib/libc/strings/strcasecmp.c b/lib/libc/strings/strcasecmp.c new file mode 100644 index 00000000..90ccc59b --- /dev/null +++ b/lib/libc/strings/strcasecmp.c @@ -0,0 +1,24 @@ +#include +#include + +int strcasecmp(const char *s1, const char *s2) +{ + unsigned char c1, c2; + + while (*s1 && *s2) { + c1 = (unsigned char)tolower((unsigned char)*s1); + c2 = (unsigned char)tolower((unsigned char)*s2); + if (c1 != c2) + return c1 - c2; + s1++; + s2++; + } + + return (unsigned char)tolower((unsigned char)*s1) - + (unsigned char)tolower((unsigned char)*s2); +} + +weak int strcasecmp_l(const char *s1, const char *s2, locale_t unused locale) +{ + return strcasecmp(s1, s2); +} -- cgit v1.2.3